aboutsummaryrefslogtreecommitdiffstats
path: root/spec/helpers/link_to_helper_spec.rb
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2014-06-03 11:35:55 +0100
committerGareth Rees <gareth@mysociety.org>2014-06-05 10:56:04 +0100
commit77ce9b795c62d8241b22878cf60ca688fa4b44a1 (patch)
tree88fced6ead005e58e9ea089da34f1cce328d0cff /spec/helpers/link_to_helper_spec.rb
parent6bd0bfe7599aee4e55bdd63196d1e2c5cc80129c (diff)
Move date helpers to DateTimeHelper
Diffstat (limited to 'spec/helpers/link_to_helper_spec.rb')
-rw-r--r--spec/helpers/link_to_helper_spec.rb47
1 files changed, 0 insertions, 47 deletions
diff --git a/spec/helpers/link_to_helper_spec.rb b/spec/helpers/link_to_helper_spec.rb
index f7be9eab0..b11c35056 100644
--- a/spec/helpers/link_to_helper_spec.rb
+++ b/spec/helpers/link_to_helper_spec.rb
@@ -145,51 +145,4 @@ describe LinkToHelper do
end
- describe 'simple_date' do
-
- it 'formats a date in html by default' do
- time = Time.utc(2012, 11, 07, 21, 30, 26)
- self.should_receive(:simple_date_html).with(time)
- simple_date(time)
- end
-
- it 'formats a date in the specified format' do
- time = Time.utc(2012, 11, 07, 21, 30, 26)
- self.should_receive(:simple_date_text).with(time)
- simple_date(time, :format => :text)
- end
-
- it 'raises an argument error if given an unrecognized format' do
- time = Time.utc(2012, 11, 07, 21, 30, 26)
- expect { simple_date(time, :format => :unknown) }.to raise_error(ArgumentError)
- end
-
- end
-
- describe 'simple_date_html' do
-
- it 'formats a date in a time tag' do
- Time.use_zone('London') do
- time = Time.utc(2012, 11, 07, 21, 30, 26)
- expected = "<time datetime=\"2012-11-07T21:30:26+00:00\" title=\"2012-11-07 21:30:26 +0000\">November 07, 2012</time>"
- simple_date_html(time).should == expected
- end
- end
-
- end
-
- describe 'simple_date_text' do
-
- it 'should respect time zones' do
- Time.use_zone('Australia/Sydney') do
- simple_date_text(Time.utc(2012, 11, 07, 21, 30, 26)).should == 'November 08, 2012'
- end
- end
-
- it 'should handle Date objects' do
- simple_date_text(Date.new(2012, 11, 21)).should == 'November 21, 2012'
- end
-
- end
-
end