diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-06-13 13:13:52 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-06-13 13:13:52 +0100 |
commit | 0eb9ef894e8c3353074caf4d39c81830e1ce2dc0 (patch) | |
tree | 4dde8a6df4053ff5fd56445da14d19ffdba837c4 /spec/controllers/public_body_controller_spec.rb | |
parent | 7d98112cc8394b3b9656f9ac5ec6da02f1c08723 (diff) |
Make sure the template rendering happens within the scope of
with_locale, so it's rendered using the correct locale.
(+ test for this)
Diffstat (limited to 'spec/controllers/public_body_controller_spec.rb')
-rw-r--r-- | spec/controllers/public_body_controller_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb index d43ebdcdd..8b84b89ec 100644 --- a/spec/controllers/public_body_controller_spec.rb +++ b/spec/controllers/public_body_controller_spec.rb @@ -31,6 +31,13 @@ describe PublicBodyController, "when showing a body" do assigns[:public_body].notes.should == "Baguette" end + it "should assign the body using same locale as that used in url_name even with wrongly set locale" do + PublicBody.with_locale(:en) do + get :show, {:url_name => "edfh", :locale => 'es'} + response.body.should include('Baguette') + end + end + it "should redirect to newest name if you use historic name of public body in URL" do get :show, :url_name => "hdink" response.should redirect_to(:controller => 'public_body', :action => 'show', :url_name => "dfh") |