diff options
author | Gareth Rees <gareth@mysociety.org> | 2014-06-03 12:34:00 +0100 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2014-06-05 10:56:04 +0100 |
commit | 6bd0bfe7599aee4e55bdd63196d1e2c5cc80129c (patch) | |
tree | a63a36c11b90f369c7c56781ed79a40d9a9a11a6 /spec/helpers/link_to_helper_spec.rb | |
parent | fee5d9384862af086613c4f09e0fd96f7bd347b8 (diff) |
Remove duplication from new correspondence urls
Diffstat (limited to 'spec/helpers/link_to_helper_spec.rb')
-rw-r--r-- | spec/helpers/link_to_helper_spec.rb | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/spec/helpers/link_to_helper_spec.rb b/spec/helpers/link_to_helper_spec.rb index 08362da6e..f7be9eab0 100644 --- a/spec/helpers/link_to_helper_spec.rb +++ b/spec/helpers/link_to_helper_spec.rb @@ -37,8 +37,12 @@ describe LinkToHelper do incoming_message_url(@incoming_message).should include('#incoming-32') end - it 'includes a cache busting parameter' do - incoming_message_url(@incoming_message).should include('nocache=incoming-32') + it 'includes does not cache by default' do + incoming_message_url(@incoming_message).should_not include('nocache=incoming-32') + end + + it 'includes a cache busting parameter if set' do + incoming_message_url(@incoming_message, :cachebust => true).should include('nocache=incoming-32') end end @@ -46,7 +50,7 @@ describe LinkToHelper do context 'for internal links' do it 'generates the incoming_message_url with the path only' do - expected = '/request/test_title?nocache=incoming-32#incoming-32' + expected = '/request/test_title#incoming-32' incoming_message_path(@incoming_message).should == expected end @@ -71,8 +75,12 @@ describe LinkToHelper do outgoing_message_url(@outgoing_message).should include('#outgoing-32') end - it 'includes a cache busting parameter' do - outgoing_message_url(@outgoing_message).should include('nocache=outgoing-32') + it 'includes does not cache by default' do + outgoing_message_url(@outgoing_message).should_not include('nocache=outgoing-32') + end + + it 'includes a cache busting parameter if set' do + outgoing_message_url(@outgoing_message, :cachebust => true).should include('nocache=outgoing-32') end end @@ -80,7 +88,7 @@ describe LinkToHelper do context 'for internal links' do it 'generates the outgoing_message_url with the path only' do - expected = '/request/test_title?nocache=outgoing-32#outgoing-32' + expected = '/request/test_title#outgoing-32' outgoing_message_path(@outgoing_message).should == expected end |