From 910dcce60088a2d0e07b67be9f272a7afc5fbfed Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Wed, 14 Aug 2013 12:09:06 +0100 Subject: Replace fixture-based spec with factory-based equivalent. --- spec/controllers/request_controller_spec.rb | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'spec/controllers/request_controller_spec.rb') diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index a15fb035f..7e26d0ada 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -770,16 +770,6 @@ describe RequestController, "when showing one request" do describe 'when making a zipfile available' do - it 'should return a 410 for a request that is hidden' do - title = 'why_do_you_have_such_a_fancy_dog' - ir = info_requests(:fancy_dog_request) - ir.prominence = 'hidden' - ir.save! - get :download_entire_request, {:url_title => title}, { :user_id => ir.user.id } - response.should render_template('request/hidden') - response.code.should == '410' - end - it "should have a different zipfile URL when the request changes" do title = 'why_do_you_have_such_a_fancy_dog' ir = info_requests(:fancy_dog_request) @@ -911,6 +901,12 @@ describe RequestController, "when handling prominence" do response.should render_template('show') end + it 'should not allow download of the entire request by admin user (or anyone)' do + session[:user_id] = FactoryGirl.create(:admin_user).id + get :download_entire_request, :url_title => @info_request.url_title + expect_hidden('hidden') + end + 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 -- cgit v1.2.3