From c9feb6a4002fc4b63021aeb5ffd6b2846ada7748 Mon Sep 17 00:00:00 2001 From: Henare Degan Date: Tue, 11 Dec 2012 15:00:40 +1100 Subject: integrate_views is render_views RSpec 2 --- spec/controllers/admin_request_controller_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/controllers/admin_request_controller_spec.rb') diff --git a/spec/controllers/admin_request_controller_spec.rb b/spec/controllers/admin_request_controller_spec.rb index 8a3934685..0709f6b0b 100644 --- a/spec/controllers/admin_request_controller_spec.rb +++ b/spec/controllers/admin_request_controller_spec.rb @@ -1,7 +1,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe AdminRequestController, "when administering requests" do - integrate_views + render_views before { basic_auth_login @request } before(:each) do @@ -82,7 +82,7 @@ describe AdminRequestController, "when administering requests" do end describe AdminRequestController, "when administering the holding pen" do - integrate_views + render_views before(:each) do basic_auth_login @request load_raw_emails_data -- cgit v1.2.3 From 5b35eaa1e976b824d7f55786f05854fa7aff9d69 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Fri, 4 Jan 2013 12:00:43 +1100 Subject: Get rid of resetting of ActionController::Routing::Routes.filters --- spec/controllers/admin_request_controller_spec.rb | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'spec/controllers/admin_request_controller_spec.rb') diff --git a/spec/controllers/admin_request_controller_spec.rb b/spec/controllers/admin_request_controller_spec.rb index 0709f6b0b..6d7ab611e 100644 --- a/spec/controllers/admin_request_controller_spec.rb +++ b/spec/controllers/admin_request_controller_spec.rb @@ -6,11 +6,6 @@ describe AdminRequestController, "when administering requests" do before(:each) do load_raw_emails_data - @old_filters = ActionController::Routing::Routes.filters - ActionController::Routing::Routes.filters = RoutingFilter::Chain.new - end - after do - ActionController::Routing::Routes.filters = @old_filters end it "shows the index/list page" do @@ -86,11 +81,6 @@ describe AdminRequestController, "when administering the holding pen" do before(:each) do basic_auth_login @request load_raw_emails_data - @old_filters = ActionController::Routing::Routes.filters - ActionController::Routing::Routes.filters = RoutingFilter::Chain.new - end - after do - ActionController::Routing::Routes.filters = @old_filters end it "shows a rejection reason for an incoming message from an invalid address" do -- cgit v1.2.3 From c0360fa374b096964b67ff5195e86ef83936c62f Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Tue, 29 Jan 2013 10:40:07 +1100 Subject: Replace use of have_text with contain from webrat or match --- spec/controllers/admin_request_controller_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/controllers/admin_request_controller_spec.rb') diff --git a/spec/controllers/admin_request_controller_spec.rb b/spec/controllers/admin_request_controller_spec.rb index 6d7ab611e..d16235717 100644 --- a/spec/controllers/admin_request_controller_spec.rb +++ b/spec/controllers/admin_request_controller_spec.rb @@ -90,7 +90,7 @@ describe AdminRequestController, "when administering the holding pen" do ir.save! receive_incoming_mail('incoming-request-plain.email', ir.incoming_email, "frob@nowhere.com") get :show_raw_email, :id => InfoRequest.holding_pen_request.get_last_response.raw_email.id - response.should have_text(/Only the authority can reply to this request/) + response.should contain "Only the authority can reply to this request" end it "allows redelivery even to a closed request" do @@ -154,7 +154,7 @@ describe AdminRequestController, "when administering the holding pen" do receive_incoming_mail('incoming-request-plain.email', ir.incoming_email, "") InfoRequest.holding_pen_request.incoming_messages.length.should == 2 get :show_raw_email, :id => interesting_email - response.should have_text(/Could not identify the request/) + response.should contain "Could not identify the request" assigns[:info_requests][0].should == ir end -- cgit v1.2.3 From 4e4ec14ebcc9ddd161bc61a5bbce9ce0cd4e3610 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Wed, 30 Jan 2013 08:16:28 +1100 Subject: Find is now being called with an integer rather than a string. All good --- spec/controllers/admin_request_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/controllers/admin_request_controller_spec.rb') diff --git a/spec/controllers/admin_request_controller_spec.rb b/spec/controllers/admin_request_controller_spec.rb index d16235717..c9d325b03 100644 --- a/spec/controllers/admin_request_controller_spec.rb +++ b/spec/controllers/admin_request_controller_spec.rb @@ -226,7 +226,7 @@ describe AdminRequestController, "when administering the holding pen" do :user => nil, :user_name => 'External User', :is_external? => true) - InfoRequest.stub!(:find).with(@info_request.id.to_s).and_return(@info_request) + InfoRequest.stub!(:find).with(@info_request.id).and_return(@info_request) @default_params = { :id => @info_request.id, :explanation => 'Foo', :reason => 'vexatious' } -- cgit v1.2.3 From fb4be794911d6f01ee46bb31753d47c414d682a1 Mon Sep 17 00:00:00 2001 From: Henare Degan Date: Mon, 25 Feb 2013 15:15:03 +1100 Subject: response.flash has been deprecated --- spec/controllers/admin_request_controller_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'spec/controllers/admin_request_controller_spec.rb') diff --git a/spec/controllers/admin_request_controller_spec.rb b/spec/controllers/admin_request_controller_spec.rb index c9d325b03..f644e0146 100644 --- a/spec/controllers/admin_request_controller_spec.rb +++ b/spec/controllers/admin_request_controller_spec.rb @@ -34,7 +34,7 @@ describe AdminRequestController, "when administering requests" do :awaiting_description => false, :allow_new_responses_from => 'anybody', :handle_rejected_responses => 'bounce' } } - response.flash[:notice].should include('successful') + request.flash[:notice].should include('successful') ir = InfoRequest.find(info_requests(:fancy_dog_request).id) ir.title.should == "Renamed" end @@ -59,7 +59,7 @@ describe AdminRequestController, "when administering requests" do it "saves edits to an outgoing_message" do outgoing_messages(:useless_outgoing_message).body.should include("fancy dog") post :update_outgoing, { :id => outgoing_messages(:useless_outgoing_message), :outgoing_message => { :body => "Why do you have such a delicious cat?" } } - response.flash[:notice].should include('successful') + request.flash[:notice].should include('successful') ir = OutgoingMessage.find(outgoing_messages(:useless_outgoing_message).id) ir.body.should include("delicious cat") end @@ -256,7 +256,7 @@ describe AdminRequestController, "when administering the holding pen" do it 'should add a notice to the flash saying that the request has been hidden' do make_request - response.flash[:notice].should == "This external request has been hidden" + request.flash[:notice].should == "This external request has been hidden" end it 'should expire the file cache for the request' do -- cgit v1.2.3 From 532a21ba4941197a13524ac3f1ce9267a46bec1d Mon Sep 17 00:00:00 2001 From: Henare Degan Date: Mon, 25 Feb 2013 17:25:59 +1100 Subject: Update to new mail sending API --- spec/controllers/admin_request_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/controllers/admin_request_controller_spec.rb') diff --git a/spec/controllers/admin_request_controller_spec.rb b/spec/controllers/admin_request_controller_spec.rb index f644e0146..b51aaa9ad 100644 --- a/spec/controllers/admin_request_controller_spec.rb +++ b/spec/controllers/admin_request_controller_spec.rb @@ -250,7 +250,7 @@ describe AdminRequestController, "when administering the holding pen" do end it 'should not send a notification email' do - ContactMailer.should_not_receive(:deliver_from_admin_message) + ContactMailer.should_not_receive(:from_admin_message) make_request end -- cgit v1.2.3 From 28bb502677289e4b2f44252f0cf839684cc3fb28 Mon Sep 17 00:00:00 2001 From: Henare Degan Date: Sun, 3 Mar 2013 17:14:58 +1100 Subject: Params are passed through as strings in Rails 3.1 --- spec/controllers/admin_request_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/controllers/admin_request_controller_spec.rb') diff --git a/spec/controllers/admin_request_controller_spec.rb b/spec/controllers/admin_request_controller_spec.rb index b51aaa9ad..b7b726507 100644 --- a/spec/controllers/admin_request_controller_spec.rb +++ b/spec/controllers/admin_request_controller_spec.rb @@ -226,7 +226,7 @@ describe AdminRequestController, "when administering the holding pen" do :user => nil, :user_name => 'External User', :is_external? => true) - InfoRequest.stub!(:find).with(@info_request.id).and_return(@info_request) + InfoRequest.stub!(:find).with(@info_request.id.to_s).and_return(@info_request) @default_params = { :id => @info_request.id, :explanation => 'Foo', :reason => 'vexatious' } -- cgit v1.2.3