diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-06-23 09:33:42 +0100 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-06-23 09:33:42 +0100 |
commit | db1a388f0a7b37cc0ceb3ca07b995b34dabdba58 (patch) | |
tree | e34df5ae0dacdbf6c3b77542b22f2d9e3799d322 /spec/controllers/general_controller_spec.rb | |
parent | a7cc84b9b2b430644fe23e6328d7ab289e7abf0a (diff) | |
parent | 7d0fea4b38c214a67b2fc4b56aa670e02a3cda61 (diff) |
Merge branch 'develop' of github.com:sebbacon/alaveteli into develop
Conflicts:
Gemfile.lock
script/handle-mail-replies
script/handle-mail-replies.rb
spec/controllers/request_controller_spec.rb
Diffstat (limited to 'spec/controllers/general_controller_spec.rb')
-rw-r--r-- | spec/controllers/general_controller_spec.rb | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index 8a08ab7d0..df2c139bd 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -77,12 +77,34 @@ describe GeneralController, "when searching" do end describe "when using different locale settings" do - home_link_regex = /href=".*\/en"/ + home_link_regex = /href=".*\/en\// it "should generate URLs with a locale prepended when there's more than one locale set" do get :frontpage response.should have_text(home_link_regex) end + it "should use our test PO files rather than the application one" do + I18n.default_locale = :es + get :frontpage + response.should have_text(/XOXO/) + I18n.default_locale = :en + end + + it "should generate URLs that include the locale when using one that includes an underscore" do + I18n.default_locale = :"en_GB" + get :frontpage + response.should have_text(/href="\/en_GB\//) + I18n.default_locale = :en + end + + it "should fall back to the language if the territory is unknown" do + I18n.default_locale = :"en_US" + get :frontpage + response.should have_text(/href="\/en\//) + response.should_not have_text(/href="\/en_US\//) + I18n.default_locale = :en + end + it "should generate URLs without a locale prepended when there's only one locale set" do old_fgt_available_locales = FastGettext.default_available_locales old_i18n_available_locales = I18n.available_locales |