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/track_controller_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'spec/controllers/track_controller_spec.rb') diff --git a/spec/controllers/track_controller_spec.rb b/spec/controllers/track_controller_spec.rb index c785960b5..cd7932e90 100644 --- a/spec/controllers/track_controller_spec.rb +++ b/spec/controllers/track_controller_spec.rb @@ -56,7 +56,7 @@ describe TrackController, "when making a new track on a request" do end describe TrackController, "when sending alerts for a track" do - integrate_views + render_views include LinkToHelper # for main_url before(:each) do @@ -134,7 +134,7 @@ describe TrackController, "when sending alerts for a track" do end describe TrackController, "when viewing RSS feed for a track" do - integrate_views + render_views before(:each) do load_raw_emails_data @@ -164,7 +164,7 @@ end describe TrackController, "when viewing JSON version of a track feed" do - integrate_views + render_views before(:each) do load_raw_emails_data @@ -206,7 +206,7 @@ end describe TrackController, "when tracking a public body" do - integrate_views + render_views before(:each) do load_raw_emails_data -- cgit v1.2.3 From 8ab884f0da68b17f33577a197ebd0e7d412a28ed Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Fri, 25 Jan 2013 11:23:43 +1100 Subject: Disable routing filter in tests by using RoutingFilter.active rather than writing to ActionController::Routing::Routes.filters --- spec/controllers/track_controller_spec.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'spec/controllers/track_controller_spec.rb') diff --git a/spec/controllers/track_controller_spec.rb b/spec/controllers/track_controller_spec.rb index cd7932e90..009ef2f4a 100644 --- a/spec/controllers/track_controller_spec.rb +++ b/spec/controllers/track_controller_spec.rb @@ -66,8 +66,7 @@ describe TrackController, "when sending alerts for a track" do it "should send alerts" do # Don't do clever locale-insertion-unto-URL stuff - old_filters = ActionController::Routing::Routes.filters - ActionController::Routing::Routes.filters = RoutingFilter::Chain.new + RoutingFilter.active = false # set the time the comment event happened at to within the last week ire = info_request_events(:silly_comment_event) @@ -115,7 +114,7 @@ describe TrackController, "when sending alerts for a track" do deliveries.size.should == 0 # Restore the routing filters - ActionController::Routing::Routes.filters = old_filters + RoutingFilter.active = true end it "should send localised alerts" do -- cgit v1.2.3 From 5acd5cced50f72d0e88a4524f5aef23525511554 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Thu, 31 Jan 2013 12:52:34 +1100 Subject: Cast mail.body to string before matching with a regex --- spec/controllers/track_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/controllers/track_controller_spec.rb') diff --git a/spec/controllers/track_controller_spec.rb b/spec/controllers/track_controller_spec.rb index 009ef2f4a..63192c99e 100644 --- a/spec/controllers/track_controller_spec.rb +++ b/spec/controllers/track_controller_spec.rb @@ -80,7 +80,7 @@ describe TrackController, "when sending alerts for a track" do mail = deliveries[0] mail.body.should =~ /Alter your subscription/ mail.to_addrs.first.to_s.should include(users(:silly_name_user).email) - mail.body =~ /(http:\/\/.*\/c\/(.*))/ + mail.body.to_s =~ /(http:\/\/.*\/c\/(.*))/ mail_url = $1 mail_token = $2 -- cgit v1.2.3 From 10a76a091bce366a30850b3f60354e5fe52abf5e Mon Sep 17 00:00:00 2001 From: Henare Degan Date: Tue, 5 Mar 2013 14:08:12 +1100 Subject: Fix track searches by changing the way the routing works --- spec/controllers/track_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/controllers/track_controller_spec.rb') diff --git a/spec/controllers/track_controller_spec.rb b/spec/controllers/track_controller_spec.rb index 63192c99e..8d9d7637b 100644 --- a/spec/controllers/track_controller_spec.rb +++ b/spec/controllers/track_controller_spec.rb @@ -49,7 +49,7 @@ describe TrackController, "when making a new track on a request" do it "should save a search track and redirect to the right place" do session[:user_id] = @user.id @track_thing.should_receive(:save!) - get :track_search_query, :query_array => ["bob variety:sent"], :feed => 'track' + get :track_search_query, :query_array => "bob variety:sent", :feed => 'track' response.should redirect_to(:controller => 'general', :action => 'search', :combined => ["bob", "requests"]) end -- cgit v1.2.3 From 2376834e80b736e4eb4f4dcbdbb3988cafa6cc5b Mon Sep 17 00:00:00 2001 From: Mark Longair Date: Wed, 29 May 2013 15:25:02 +0100 Subject: Make sure Atom feeds are served with content type application/atom+xml Fixes #961 --- spec/controllers/track_controller_spec.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'spec/controllers/track_controller_spec.rb') diff --git a/spec/controllers/track_controller_spec.rb b/spec/controllers/track_controller_spec.rb index e9501b1ed..5a766b1e1 100644 --- a/spec/controllers/track_controller_spec.rb +++ b/spec/controllers/track_controller_spec.rb @@ -144,6 +144,7 @@ describe TrackController, "when viewing RSS feed for a track" do get :track_request, :feed => 'feed', :url_title => track_thing.info_request.url_title response.should render_template('track/atom_feed') + response.content_type.should == 'application/atom+xml' # XXX should check it is an atom.builder type being rendered, not sure how to assigns[:xapian_object].matches_estimated.should == 3 -- cgit v1.2.3