From aeef1a20034b0ffb57f10d3bf2d5ed291bcf789c Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Tue, 12 Feb 2013 14:11:06 +1100 Subject: Retain filter settings when redirecting a public body to its canonical url --- spec/controllers/public_body_controller_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'spec/controllers/public_body_controller_spec.rb') 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") -- cgit v1.2.3