diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-07-23 18:23:35 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-07-23 18:23:35 +0100 |
commit | 8c8ff1c840451c9ed598c1b8c68ed72a1a938a38 (patch) | |
tree | 5e6d753df4c436f4b87d46b3f1abf322975dd788 /spec/controllers | |
parent | 86c185f0d0195b300fa26b99a409d0596d590233 (diff) |
Patch Globalize to compensate for the way gettext_i18n_rails patches 118n.locale in the handling of locales with underscores. Fixes #999.
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/public_body_controller_spec.rb | 18 |
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 |