diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-08-14 12:07:07 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-09-16 12:41:44 +0100 |
commit | fdf40f654c7d8ff45cfd6d5af179def8389f9d3a (patch) | |
tree | cdb3201d19a1840d9d25d76db81e5a1aab63548d /spec/controllers/request_controller_spec.rb | |
parent | 55a114c83e2fef9f5dfced86d0030fc2acd4a39a (diff) |
Use expectation for hidden responses more generally.
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index fa37826c8..a15fb035f 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -826,7 +826,7 @@ end describe RequestController, "when handling prominence" do - def expect_hidden_attachment(hidden_template) + def expect_hidden(hidden_template) response.content_type.should == "text/html" response.should render_template(hidden_template) response.code.should == '410' @@ -841,13 +841,13 @@ describe RequestController, "when handling prominence" do it "should not show request if you're not logged in" do get :show, :url_title => @info_request.url_title - response.should render_template('hidden') + expect_hidden('hidden') end it "should not show request even if logged in as their owner" do session[:user_id] = @info_request.user.id get :show, :url_title => @info_request.url_title - response.should render_template('hidden') + expect_hidden('hidden') end it 'should not show request if requested using json' do @@ -869,7 +869,7 @@ describe RequestController, "when handling prominence" do :part => 2, :file_name => 'interesting.pdf', :skip_cache => 1 - expect_hidden_attachment('request/hidden') + expect_hidden('request/hidden') end it 'should not generate an HTML version of an attachment for a request whose prominence @@ -894,13 +894,13 @@ describe RequestController, "when handling prominence" do it "should not show request if you're not logged in" do get :show, :url_title => @info_request.url_title - response.should render_template('hidden') + expect_hidden('hidden') end it "should show request to requester and admin if logged in" do session[:user_id] = FactoryGirl.create(:user).id get :show, :url_title => @info_request.url_title - response.should render_template('hidden') + expect_hidden('hidden') session[:user_id] = @info_request.user.id get :show, :url_title => @info_request.url_title @@ -935,7 +935,7 @@ describe RequestController, "when handling prominence" do :part => 2, :file_name => 'interesting.pdf', :skip_cache => 1 - expect_hidden_attachment('request/hidden_correspondence') + expect_hidden('request/hidden_correspondence') end it 'should not download attachments for the request owner' do @@ -945,7 +945,7 @@ describe RequestController, "when handling prominence" do :part => 2, :file_name => 'interesting.pdf', :skip_cache => 1 - expect_hidden_attachment('request/hidden_correspondence') + expect_hidden('request/hidden_correspondence') end it 'should download attachments for an admin user', :focus => true do @@ -995,7 +995,7 @@ describe RequestController, "when handling prominence" do :part => 2, :file_name => 'interesting.pdf', :skip_cache => 1 - expect_hidden_attachment('request/hidden_correspondence') + expect_hidden('request/hidden_correspondence') end it 'should download attachments for the request owner' do |