diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-01-09 17:00:04 +0000 |
---|---|---|
committer | Mark Longair <mhl@pobox.com> | 2014-01-14 09:14:13 +0000 |
commit | 3e3b7a0d5a1401b18c88683581a545708c65aaf0 (patch) | |
tree | 6300ae593ba150983f6a2f75695c28d6b72a6827 | |
parent | 68c192aa36e2a091fb12b8b227ba2fa387ba6ab5 (diff) |
Make test fail as with issue #1001
This requires us to clear the I18n.fallbacks when changing the
I18n.default_locale, otherwise the old default locale remains there.
-rw-r--r-- | spec/spec_helper.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1eeb8603b..52752dca5 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -187,11 +187,16 @@ Spork.prefork do end end + # Reset the default locale, making sure that the previous default locale + # is also cleared from the fallbacks def with_default_locale(locale) original_default_locale = I18n.default_locale + original_fallbacks = I18n.fallbacks + I18n.fallbacks = nil I18n.default_locale = locale yield ensure + I18n.fallbacks = original_fallbacks I18n.default_locale = original_default_locale end |