From 5ac63b9c812fc914fd52de7dae813e1bb5f0f36e Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 17 Mar 2014 17:35:21 +0000 Subject: Move track descriptions to a helper. We can access url generation methods more easily here. --- spec/helpers/track_helper_spec.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'spec/helpers/track_helper_spec.rb') 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(anything matching text 'Example Query') + 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(successful requests) + 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(new requests) + 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 -- cgit v1.2.3