diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-06-20 10:59:54 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-06-20 10:59:54 +0100 |
commit | 7d0fea4b38c214a67b2fc4b56aa670e02a3cda61 (patch) | |
tree | 85e77cf7ba0656efbacf1497baff2ef96887bd3b /spec/controllers/general_controller_spec.rb | |
parent | 6ef57090e436e01bc5de801bc7acb6bfadb5c490 (diff) | |
parent | 6c4c822ef7a4491bf821326af779e5be9118c0a1 (diff) |
Merge branch 'master' into develop
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 |