diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-08-14 11:43:56 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-09-16 12:41:44 +0100 |
commit | 55a114c83e2fef9f5dfced86d0030fc2acd4a39a (patch) | |
tree | 4021f0792e8a4d577bd4e8b129677d22c3342dab /spec/controllers | |
parent | 0bb0c97831d22a8ad29fd4c4a9217327c77dfcfd (diff) |
Fix request in spec for hidden attachments not being viewed.
Add another spec for the same behaviour when an incoming message is
hidden.
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 26a5de29c..fa37826c8 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -911,10 +911,14 @@ describe RequestController, "when handling prominence" do response.should render_template('show') end - it 'should not cache an attachment when showing the request to the requester or admin' do + it 'should not cache an attachment when showing an attachment to the requester or admin' do session[:user_id] = @info_request.user.id + incoming_message = @info_request.incoming_messages.first @controller.should_not_receive(:foi_fragment_cache_write) - get :show, :url_title => @info_request.url_title + get :get_attachment, :incoming_message_id => incoming_message.id, + :id => @info_request.id, + :part => 2, + :file_name => 'interesting.pdf' end end @@ -966,6 +970,15 @@ describe RequestController, "when handling prominence" do :skip_cache => 1 end.should raise_error(ActiveRecord::RecordNotFound) end + + it 'should not cache an attachment when showing an attachment to the requester or admin' do + session[:user_id] = @info_request.user.id + @controller.should_not_receive(:foi_fragment_cache_write) + get :get_attachment, :incoming_message_id => @incoming_message.id, + :id => @info_request.id, + :part => 2, + :file_name => 'interesting.pdf' + end end context 'when the incoming message has prominence requester_only' do |