aboutsummaryrefslogtreecommitdiffstats
path: root/spec/helpers/track_helper_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2014-03-17 17:35:21 +0000
committerLouise Crow <louise.crow@gmail.com>2014-03-24 13:07:51 +0000
commit5ac63b9c812fc914fd52de7dae813e1bb5f0f36e (patch)
tree15feb8d085ba68d7a8b02dce7ff17502a3aa8112 /spec/helpers/track_helper_spec.rb
parent5cb467c469d9a34336da483e47b931c9dd5b9078 (diff)
Move track descriptions to a helper.
We can access url generation methods more easily here.
Diffstat (limited to 'spec/helpers/track_helper_spec.rb')
-rw-r--r--spec/helpers/track_helper_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/helpers/track_helper_spec.rb b/spec/helpers/track_helper_spec.rb
index bd4be5c3e..80857067b 100644
--- a/spec/helpers/track_helper_spec.rb
+++ b/spec/helpers/track_helper_spec.rb
@@ -31,6 +31,11 @@ describe TrackHelper do
unsubscribe_notice(@track_thing).should == expected
end
+ it 'should create a description of the track' do
+ expected = %Q(<a href="/search/Example%20Query/newest/advanced">anything matching text 'Example Query'</a>)
+ track_description(@track_thing).should == expected
+ end
+
end
describe 'when displaying notices for a user track' do
@@ -59,6 +64,11 @@ describe TrackHelper do
unsubscribe_notice(@track_thing).should == expected
end
+ it 'should create a description of the track' do
+ expected = %Q('#{user_link(@track_thing.tracked_user)}', a person)
+ track_description(@track_thing).should == expected
+ end
+
end
describe 'when displaying notices for a public body track' do
@@ -86,6 +96,11 @@ describe TrackHelper do
expected = %Q(You are no longer following '#{public_body_link(@track_thing.public_body)}', a public authority)
unsubscribe_notice(@track_thing).should == expected
end
+
+ it 'should create a description of the track' do
+ expected = %Q('#{public_body_link(@track_thing.public_body)}', a public authority)
+ track_description(@track_thing).should == expected
+ end
end
describe 'when displaying notices for a successful request track' do
@@ -114,6 +129,10 @@ describe TrackHelper do
unsubscribe_notice(@track_thing).should == expected
end
+ it 'should create a description of the track' do
+ expected = %Q(<a href="/list/successful">successful requests</a>)
+ track_description(@track_thing).should == expected
+ end
end
describe 'when displaying notices for a new request track' do
@@ -142,6 +161,11 @@ describe TrackHelper do
unsubscribe_notice(@track_thing).should == expected
end
+ it 'should create a description of the track' do
+ expected = %Q(<a href="/list">new requests</a>)
+ track_description(@track_thing).should == expected
+ end
+
end
describe 'when displaying notices for a request update track' do
@@ -170,6 +194,11 @@ describe TrackHelper do
unsubscribe_notice(@track_thing).should == expected
end
+ it 'should create a description of the track' do
+ expected = %Q('#{request_link(@track_thing.info_request)}', a request)
+ track_description(@track_thing).should == expected
+ end
+
end
end