aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/request_controller_spec.rb2
-rw-r--r--spec/helpers/link_to_helper_spec.rb20
2 files changed, 15 insertions, 7 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index bde1c136a..070511fb0 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -567,7 +567,7 @@ describe RequestController, "when showing one request" do
get :get_attachment_as_html, :incoming_message_id => im.id, :id => ir.id, :part => 5, :file_name => 'hello world.txt', :skip_cache => 1
response.status.should == 303
new_location = response.header['Location']
- new_location.should match(/request\/#{ir.url_title}\?nocache=incoming-#{im.id}#incoming-#{im.id}/)
+ new_location.should match(/request\/#{ir.url_title}#incoming-#{im.id}/)
end
it "should find a uniquely named filename even if the URL part number was wrong" do
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