aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/public_body_controller_spec.rb14
-rw-r--r--spec/models/public_body_spec.rb2
2 files changed, 6 insertions, 10 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
diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb
index f247f561c..0b1bfccd7 100644
--- a/spec/models/public_body_spec.rb
+++ b/spec/models/public_body_spec.rb
@@ -378,7 +378,7 @@ describe PublicBody, " when loading CSV files" do
PublicBody.count.should == original_count + 3
- # XXX Not sure why trying to do a PublicBody.with_locale fails here. Seems related to
+ # XXX Not sure why trying to do a I18n.with_locale fails here. Seems related to
# the way categories are loaded every time from the PublicBody class. For now we just
# test some translation was done.
body = PublicBody.find_by_name('North West Fake Authority')