From aec70771b7029f8c312e779a6e7fa6d5537abbed Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 17 Mar 2014 17:26:49 +0000 Subject: Add notices for subscribing something you're subscribed to. These notices are full sentences, rather than being composed of phrases, which should make them easier to translate. --- spec/helpers/track_helper_spec.rb | 86 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 spec/helpers/track_helper_spec.rb (limited to 'spec/helpers/track_helper_spec.rb') diff --git a/spec/helpers/track_helper_spec.rb b/spec/helpers/track_helper_spec.rb new file mode 100644 index 000000000..a009f87ac --- /dev/null +++ b/spec/helpers/track_helper_spec.rb @@ -0,0 +1,86 @@ +require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') + +describe TrackHelper do + + include TrackHelper + include LinkToHelper + + describe 'when displaying notices for a search track' do + + before do + @track_thing = FactoryGirl.build(:search_track) + end + + it 'should create an already subscribed_notice' do + expected = %Q(You are already subscribed to this search) + already_subscribed_notice(@track_thing).should == expected + end + + end + + describe 'when displaying notices for a user track' do + + before do + @track_thing = FactoryGirl.build(:user_track) + end + + it 'should create an already subscribed_notice' do + expected = %Q(You are already subscribed to '#{user_link(@track_thing.tracked_user)}', a person) + already_subscribed_notice(@track_thing).should == expected + end + + end + + describe 'when displaying notices for a public body track' do + + before do + @track_thing = FactoryGirl.build(:public_body_track) + end + + it 'should create an already subscribed_notice' do + expected = %Q(You are already subscribed to '#{public_body_link(@track_thing.public_body)}', a public authority) + already_subscribed_notice(@track_thing).should == expected + end + + end + + describe 'when displaying notices for a successful request track' do + + before do + @track_thing = FactoryGirl.build(:successful_request_track) + end + + it 'should create an already subscribed_notice' do + expected = %Q(You are already subscribed to any successful requests) + already_subscribed_notice(@track_thing).should == expected + end + + end + + describe 'when displaying notices for a new request track' do + + before do + @track_thing = FactoryGirl.build(:new_request_track) + end + + it 'should create an already subscribed_notice' do + expected = %Q(You are already subscribed to any new requests) + already_subscribed_notice(@track_thing).should == expected + end + + end + + describe 'when displaying notices for a request update track' do + + before do + @track_thing = FactoryGirl.build(:request_update_track) + end + + it 'should create an already subscribed_notice' do + expected = %Q(You are already subscribed to '#{request_link(@track_thing.info_request)}', a request) + already_subscribed_notice(@track_thing).should == expected + end + + end + +end -- cgit v1.2.3 From a00067262fd7171a39e74a4ebcd75a5758e12ee6 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 17 Mar 2014 17:30:34 +0000 Subject: Add notices for subscribing to something. These notices are complete sentences, not composed on the fly, so should be easier to translate. --- spec/helpers/track_helper_spec.rb | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 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 a009f87ac..d2c277993 100644 --- a/spec/helpers/track_helper_spec.rb +++ b/spec/helpers/track_helper_spec.rb @@ -16,6 +16,16 @@ describe TrackHelper do already_subscribed_notice(@track_thing).should == expected end + it 'should create an email subscription notice' do + expected = %Q(You will now be emailed updates about this search) + subscribe_email_notice(@track_thing).should == expected + end + + it 'should create a following subscription notice' do + expected = %Q(You are now following updates about this search) + subscribe_follow_notice(@track_thing).should == expected + end + end describe 'when displaying notices for a user track' do @@ -29,6 +39,16 @@ describe TrackHelper do already_subscribed_notice(@track_thing).should == expected end + it 'should create an email subscription notice' do + expected = %Q(You will now be emailed updates about '#{user_link(@track_thing.tracked_user)}', a person) + subscribe_email_notice(@track_thing).should == expected + end + + it 'should create a following subscription notice' do + expected = %Q(You are now following updates about '#{user_link(@track_thing.tracked_user)}', a person) + subscribe_follow_notice(@track_thing).should == expected + end + end describe 'when displaying notices for a public body track' do @@ -42,6 +62,16 @@ describe TrackHelper do already_subscribed_notice(@track_thing).should == expected end + it 'should create an email subscription notice' do + expected = %Q(You will now be emailed updates about '#{public_body_link(@track_thing.public_body)}', a public authority) + subscribe_email_notice(@track_thing).should == expected + end + + it 'should create a following subscription notice' do + expected = %Q(You are now following updates about '#{public_body_link(@track_thing.public_body)}', a public authority) + subscribe_follow_notice(@track_thing).should == expected + end + end describe 'when displaying notices for a successful request track' do @@ -55,6 +85,16 @@ describe TrackHelper do already_subscribed_notice(@track_thing).should == expected end + it 'should create an email subscription notice' do + expected = %Q(You will now be emailed updates about successful requests) + subscribe_email_notice(@track_thing).should == expected + end + + it 'should create a following subscription notice' do + expected = %Q(You are now following updates about successful requests) + subscribe_follow_notice(@track_thing).should == expected + end + end describe 'when displaying notices for a new request track' do @@ -68,6 +108,16 @@ describe TrackHelper do already_subscribed_notice(@track_thing).should == expected end + it 'should create an email subscription notice' do + expected = %Q(You will now be emailed updates about any new requests) + subscribe_email_notice(@track_thing).should == expected + end + + it 'should create a following subscription notice' do + expected = %Q(You are now following updates about new requests) + subscribe_follow_notice(@track_thing).should == expected + end + end describe 'when displaying notices for a request update track' do @@ -81,6 +131,16 @@ describe TrackHelper do already_subscribed_notice(@track_thing).should == expected end + it 'should create an email subscription notice' do + expected = %Q(You will now be emailed updates about '#{request_link(@track_thing.info_request)}', a request) + subscribe_email_notice(@track_thing).should == expected + end + + it 'should create a following subscription notice' do + expected = %Q(You are now following updates about '#{request_link(@track_thing.info_request)}', a request) + subscribe_follow_notice(@track_thing).should == expected + end + end end -- cgit v1.2.3 From 5cb467c469d9a34336da483e47b931c9dd5b9078 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 17 Mar 2014 17:32:02 +0000 Subject: Add notices for unsubscribing from things. These are full sentences, not composed on the fly, so should be easier to translate. --- 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 d2c277993..bd4be5c3e 100644 --- a/spec/helpers/track_helper_spec.rb +++ b/spec/helpers/track_helper_spec.rb @@ -26,6 +26,11 @@ describe TrackHelper do subscribe_follow_notice(@track_thing).should == expected end + it 'should create an unsubscribe notice' do + expected = %Q(You are no longer following this search) + unsubscribe_notice(@track_thing).should == expected + end + end describe 'when displaying notices for a user track' do @@ -49,6 +54,11 @@ describe TrackHelper do subscribe_follow_notice(@track_thing).should == expected end + it 'should create an unsubscribe notice' do + expected = %Q(You are no longer following '#{user_link(@track_thing.tracked_user)}', a person) + unsubscribe_notice(@track_thing).should == expected + end + end describe 'when displaying notices for a public body track' do @@ -72,6 +82,10 @@ describe TrackHelper do subscribe_follow_notice(@track_thing).should == expected end + it 'should create an unsubscribe notice' 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 end describe 'when displaying notices for a successful request track' do @@ -95,6 +109,11 @@ describe TrackHelper do subscribe_follow_notice(@track_thing).should == expected end + it 'should create an unsubscribe notice' do + expected = %Q(You are no longer following successful requests) + unsubscribe_notice(@track_thing).should == expected + end + end describe 'when displaying notices for a new request track' do @@ -118,6 +137,11 @@ describe TrackHelper do subscribe_follow_notice(@track_thing).should == expected end + it 'should create an unsubscribe notice' do + expected = %Q(You are no longer following new requests) + unsubscribe_notice(@track_thing).should == expected + end + end describe 'when displaying notices for a request update track' do @@ -141,6 +165,11 @@ describe TrackHelper do subscribe_follow_notice(@track_thing).should == expected end + it 'should create an unsubscribe notice' do + expected = %Q(You are no longer following '#{request_link(@track_thing.info_request)}', a request) + unsubscribe_notice(@track_thing).should == expected + end + end end -- cgit v1.2.3 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 From b3fa23047bf96bd6a08273c9491ac1ee3b4a3f80 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 15 May 2014 16:02:56 +0100 Subject: Update specs for changes to translations in 962e1d2b0edb6c0933ba42dd7690c38ba7d08f91 --- spec/helpers/track_helper_spec.rb | 48 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (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 80857067b..b6252ab39 100644 --- a/spec/helpers/track_helper_spec.rb +++ b/spec/helpers/track_helper_spec.rb @@ -12,22 +12,22 @@ describe TrackHelper do end it 'should create an already subscribed_notice' do - expected = %Q(You are already subscribed to this search) + expected = %Q(You are already subscribed to this search.) already_subscribed_notice(@track_thing).should == expected end it 'should create an email subscription notice' do - expected = %Q(You will now be emailed updates about this search) + expected = %Q(You will now be emailed updates about this search.) subscribe_email_notice(@track_thing).should == expected end it 'should create a following subscription notice' do - expected = %Q(You are now following updates about this search) + expected = %Q(You are now following updates about this search.) subscribe_follow_notice(@track_thing).should == expected end it 'should create an unsubscribe notice' do - expected = %Q(You are no longer following this search) + expected = %Q(You are no longer following this search.) unsubscribe_notice(@track_thing).should == expected end @@ -45,22 +45,22 @@ describe TrackHelper do end it 'should create an already subscribed_notice' do - expected = %Q(You are already subscribed to '#{user_link(@track_thing.tracked_user)}', a person) + expected = %Q(You are already subscribed to '#{user_link(@track_thing.tracked_user)}', a person.) already_subscribed_notice(@track_thing).should == expected end it 'should create an email subscription notice' do - expected = %Q(You will now be emailed updates about '#{user_link(@track_thing.tracked_user)}', a person) + expected = %Q(You will now be emailed updates about '#{user_link(@track_thing.tracked_user)}', a person.) subscribe_email_notice(@track_thing).should == expected end it 'should create a following subscription notice' do - expected = %Q(You are now following updates about '#{user_link(@track_thing.tracked_user)}', a person) + expected = %Q(You are now following updates about '#{user_link(@track_thing.tracked_user)}', a person.) subscribe_follow_notice(@track_thing).should == expected end it 'should create an unsubscribe notice' do - expected = %Q(You are no longer following '#{user_link(@track_thing.tracked_user)}', a person) + expected = %Q(You are no longer following '#{user_link(@track_thing.tracked_user)}', a person.) unsubscribe_notice(@track_thing).should == expected end @@ -78,22 +78,22 @@ describe TrackHelper do end it 'should create an already subscribed_notice' do - expected = %Q(You are already subscribed to '#{public_body_link(@track_thing.public_body)}', a public authority) + expected = %Q(You are already subscribed to '#{public_body_link(@track_thing.public_body)}', a public authority.) already_subscribed_notice(@track_thing).should == expected end it 'should create an email subscription notice' do - expected = %Q(You will now be emailed updates about '#{public_body_link(@track_thing.public_body)}', a public authority) + expected = %Q(You will now be emailed updates about '#{public_body_link(@track_thing.public_body)}', a public authority.) subscribe_email_notice(@track_thing).should == expected end it 'should create a following subscription notice' do - expected = %Q(You are now following updates about '#{public_body_link(@track_thing.public_body)}', a public authority) + expected = %Q(You are now following updates about '#{public_body_link(@track_thing.public_body)}', a public authority.) subscribe_follow_notice(@track_thing).should == expected end it 'should create an unsubscribe notice' do - expected = %Q(You are no longer following '#{public_body_link(@track_thing.public_body)}', a public authority) + expected = %Q(You are no longer following '#{public_body_link(@track_thing.public_body)}', a public authority.) unsubscribe_notice(@track_thing).should == expected end @@ -110,22 +110,22 @@ describe TrackHelper do end it 'should create an already subscribed_notice' do - expected = %Q(You are already subscribed to any successful requests) + expected = %Q(You are already subscribed to any successful requests.) already_subscribed_notice(@track_thing).should == expected end it 'should create an email subscription notice' do - expected = %Q(You will now be emailed updates about successful requests) + expected = %Q(You will now be emailed updates about successful requests.) subscribe_email_notice(@track_thing).should == expected end it 'should create a following subscription notice' do - expected = %Q(You are now following updates about successful requests) + expected = %Q(You are now following updates about successful requests.) subscribe_follow_notice(@track_thing).should == expected end it 'should create an unsubscribe notice' do - expected = %Q(You are no longer following successful requests) + expected = %Q(You are no longer following successful requests.) unsubscribe_notice(@track_thing).should == expected end @@ -142,22 +142,22 @@ describe TrackHelper do end it 'should create an already subscribed_notice' do - expected = %Q(You are already subscribed to any new requests) + expected = %Q(You are already subscribed to any new requests.) already_subscribed_notice(@track_thing).should == expected end it 'should create an email subscription notice' do - expected = %Q(You will now be emailed updates about any new requests) + expected = %Q(You will now be emailed updates about any new requests.) subscribe_email_notice(@track_thing).should == expected end it 'should create a following subscription notice' do - expected = %Q(You are now following updates about new requests) + expected = %Q(You are now following updates about new requests.) subscribe_follow_notice(@track_thing).should == expected end it 'should create an unsubscribe notice' do - expected = %Q(You are no longer following new requests) + expected = %Q(You are no longer following new requests.) unsubscribe_notice(@track_thing).should == expected end @@ -175,22 +175,22 @@ describe TrackHelper do end it 'should create an already subscribed_notice' do - expected = %Q(You are already subscribed to '#{request_link(@track_thing.info_request)}', a request) + expected = %Q(You are already subscribed to '#{request_link(@track_thing.info_request)}', a request.) already_subscribed_notice(@track_thing).should == expected end it 'should create an email subscription notice' do - expected = %Q(You will now be emailed updates about '#{request_link(@track_thing.info_request)}', a request) + expected = %Q(You will now be emailed updates about '#{request_link(@track_thing.info_request)}', a request.) subscribe_email_notice(@track_thing).should == expected end it 'should create a following subscription notice' do - expected = %Q(You are now following updates about '#{request_link(@track_thing.info_request)}', a request) + expected = %Q(You are now following updates about '#{request_link(@track_thing.info_request)}', a request.) subscribe_follow_notice(@track_thing).should == expected end it 'should create an unsubscribe notice' do - expected = %Q(You are no longer following '#{request_link(@track_thing.info_request)}', a request) + expected = %Q(You are no longer following '#{request_link(@track_thing.info_request)}', a request.) unsubscribe_notice(@track_thing).should == expected end -- cgit v1.2.3