diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-08-14 12:09:06 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-09-16 12:41:44 +0100 |
commit | 910dcce60088a2d0e07b67be9f272a7afc5fbfed (patch) | |
tree | b4001b66d5df0387acc2fc5221b290843d1fc8e9 /spec/controllers | |
parent | fdf40f654c7d8ff45cfd6d5af179def8389f9d3a (diff) |
Replace fixture-based spec with factory-based equivalent.
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 16 |
1 files changed, 6 insertions, 10 deletions
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 |