diff options
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/admin_censor_rule_controller_spec.rb | 10 | ||||
-rw-r--r-- | spec/controllers/public_body_controller_spec.rb | 5 | ||||
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 4 | ||||
-rw-r--r-- | spec/controllers/track_controller_spec.rb | 3 |
4 files changed, 16 insertions, 6 deletions
diff --git a/spec/controllers/admin_censor_rule_controller_spec.rb b/spec/controllers/admin_censor_rule_controller_spec.rb index 8893a858b..fb9ddf594 100644 --- a/spec/controllers/admin_censor_rule_controller_spec.rb +++ b/spec/controllers/admin_censor_rule_controller_spec.rb @@ -2,10 +2,14 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe AdminCensorRuleController, "when making censor rules from the admin interface" do integrate_views - before { basic_auth_login @request } - + before do + basic_auth_login @request + PurgeRequest.destroy_all + end + + it "should create a censor rule and purge the corresponding request from varnish" do - ir = info_requests(:fancy_dog_request) + ir = info_requests(:fancy_dog_request) post :create, :censor_rule => { :text => "meat", :replacement => "tofu", diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb index 29ece18cb..5f4012737 100644 --- a/spec/controllers/public_body_controller_spec.rb +++ b/spec/controllers/public_body_controller_spec.rb @@ -67,6 +67,11 @@ describe PublicBodyController, "when showing a body" do ActionController::Routing::Routes.filters = old_filters end + it "should remember the filter (view) setting on redirecting" do + get :show, :show_locale => "es", :url_name => "tgq", :view => 'successful' + response.should redirect_to show_public_body_successful_url(:url_name => "etgq") + end + it "should redirect to newest name if you use historic name of public body in URL" do get :show, :url_name => "hdink", :view => 'all' response.should redirect_to(:controller => 'public_body', :action => 'show', :url_name => "dfh") diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 6f25b605a..21dd0853a 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -121,7 +121,9 @@ end describe RequestController, "when changing things that appear on the request page" do - integrate_views + before do + PurgeRequest.destroy_all + end it "should purge the downstream cache when mail is received" do ir = info_requests(:fancy_dog_request) diff --git a/spec/controllers/track_controller_spec.rb b/spec/controllers/track_controller_spec.rb index c785960b5..5505afe59 100644 --- a/spec/controllers/track_controller_spec.rb +++ b/spec/controllers/track_controller_spec.rb @@ -57,7 +57,6 @@ end describe TrackController, "when sending alerts for a track" do integrate_views - include LinkToHelper # for main_url before(:each) do load_raw_emails_data @@ -105,7 +104,7 @@ describe TrackController, "when sending alerts for a track" do # Given we can't click the link, check the token is right instead post_redirect = PostRedirect.find_by_email_token(mail_token) - expected_url = main_url("/user/" + users(:silly_name_user).url_name + "#email_subscriptions") # XXX can't call URL making functions here, what is correct way to do this? + expected_url = show_user_url(:url_name => users(:silly_name_user).url_name, :anchor => "email_subscriptions") post_redirect.uri.should == expected_url # Check nothing more is delivered if we try again |