aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/public_body_controller_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb
index 68e02e000..4e1841164 100644
--- a/spec/controllers/public_body_controller_spec.rb
+++ b/spec/controllers/public_body_controller_spec.rb
@@ -48,6 +48,12 @@ describe PublicBodyController, "when showing a body" do
response.should contain("Baguette")
end
+ it 'should show public body names in the selected locale language if present for a locale with underscores' do
+ AlaveteliLocalization.set_locales('he_IL en', 'en')
+ get :show, {:url_name => 'dfh', :view => 'all', :locale => 'he_IL'}
+ response.should contain('Hebrew Humpadinking')
+ end
+
it "should redirect use to the relevant locale even when url_name is for a different locale" do
get :show, {:url_name => "edfh", :view => 'all'}
response.should redirect_to "http://test.host/body/dfh"
@@ -85,6 +91,18 @@ describe PublicBodyController, "when listing bodies" do
assigns[:public_bodies].include?(@english_only).should == true
end
+ it 'should show public body names in the selected locale language if present' do
+ get :list, {:locale => 'es'}
+ response.should contain('El Department for Humpadinking')
+ end
+
+ it 'should show public body names in the selected locale language if present for a locale with underscores' do
+ AlaveteliLocalization.set_locales('he_IL en', 'en')
+ get :list, {:locale => 'he_IL'}
+ response.should contain('Hebrew Humpadinking')
+ end
+
+
it "should list bodies in alphabetical order" do
# Note that they are alphabetised by localised name
get :list