diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-07-18 15:33:05 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-07-18 17:43:11 +0100 |
commit | 9fe48c5b9db1c0ba6c1a59f0d092c88e5cae1aa0 (patch) | |
tree | 6a244ebe1422fa9fe627a7b4eebf2055adc6016e /spec/controllers/public_body_controller_spec.rb | |
parent | 6d67f4df65f8b56c9d54d71d449d46b1c6c92be2 (diff) |
Switch routing-filter (which takes locale out of the params and puts it in the URL) off by default in model, controller, and helper tests. This means we can supply the locale as a param. Turn it on specifically for a couple of controller tests that test routing, and change other url localization tests into integration tests.
Diffstat (limited to 'spec/controllers/public_body_controller_spec.rb')
-rw-r--r-- | spec/controllers/public_body_controller_spec.rb | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb index e01bcb0a6..68e02e000 100644 --- a/spec/controllers/public_body_controller_spec.rb +++ b/spec/controllers/public_body_controller_spec.rb @@ -43,28 +43,14 @@ describe PublicBodyController, "when showing a body" do :conditions => ["public_body_id = ?", public_bodies(:humpadink_public_body).id]) end - it "should redirect to the canonical name in the chosen locale" do - get :show, {:url_name => "dfh", :view => 'all', :show_locale => "es"} - response.should redirect_to "http://test.host/es/body/edfh" - end - - it "should assign the body using same locale as that used in url_name" do - get :show, {:url_name => "edfh", :view => 'all', :show_locale => "es"} + it "should display the body using same locale as that used in url_name" do + get :show, {:url_name => "edfh", :view => 'all', :locale => "es"} response.should contain("Baguette") end it "should redirect use to the relevant locale even when url_name is for a different locale" do - RoutingFilter.active = false - get :show, {:url_name => "edfh", :view => 'all'} response.should redirect_to "http://test.host/body/dfh" - - RoutingFilter.active = true - 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 'http://test.host/es/body/etgq/successful' end it "should redirect to newest name if you use historic name of public body in URL" do @@ -95,10 +81,8 @@ describe PublicBodyController, "when listing bodies" do :last_edit_comment => '') @english_only.save end - I18n.with_locale(:es) do - get :list - assigns[:public_bodies].include?(@english_only).should == true - end + get :list, {:locale => 'es'} + assigns[:public_bodies].include?(@english_only).should == true end it "should list bodies in alphabetical order" do |