aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/public_body_controller_spec.rb
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-01-31 08:21:22 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-01-31 08:31:44 +1100
commit6df81c66932773b4a461816c9cd6b85cf7157776 (patch)
tree88c2ba867afab54251bc8a33136ec05a17c6b940 /spec/controllers/public_body_controller_spec.rb
parent26c9c6a3f0f5bb33fa52841d5854bf52b7cf2e20 (diff)
parentafa9ef14323dfbfd412f0c8872e0b3736d60e7a3 (diff)
Merge branch 'i18n_rails3_preparation' into rails-3-spike
Conflicts: Gemfile.lock app/controllers/general_controller.rb app/controllers/public_body_controller.rb spec/controllers/public_body_controller_spec.rb
Diffstat (limited to 'spec/controllers/public_body_controller_spec.rb')
-rw-r--r--spec/controllers/public_body_controller_spec.rb14
1 files changed, 5 insertions, 9 deletions
diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb
index 3a42b535f..445128db7 100644
--- a/spec/controllers/public_body_controller_spec.rb
+++ b/spec/controllers/public_body_controller_spec.rb
@@ -43,18 +43,14 @@ describe PublicBodyController, "when showing a body" do
:conditions => ["public_body_id = ?", public_bodies(:humpadink_public_body).id])
end
- it "should assign the body using different locale from that used for url_name" do
- I18n.with_locale(:es) do
- get :show, {:url_name => "dfh", :view => 'all'}
- assigns[:public_body].notes.should == "Baguette"
- 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
- I18n.with_locale(:es) do
- get :show, {:url_name => "edfh", :view => 'all'}
- assigns[:public_body].notes.should == "Baguette"
- end
+ get :show, {:url_name => "edfh", :view => 'all', :show_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