aboutsummaryrefslogtreecommitdiffstats
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2014-01-14 15:34:55 +0000
committerLouise Crow <louise.crow@gmail.com>2014-01-14 15:34:55 +0000
commit09a7180b3f5ddbed54da23a6985fff196cc36af2 (patch)
tree8284d33e672289edc8931776cc7f08c29492b830 /spec/spec_helper.rb
parent425c2c90c4515bb6b26cee1e8748f68796b2dc26 (diff)
parentbde6832d6cc9d98d48e50b0c13ac83ccfd78dd58 (diff)
Merge branch 'rails-3-develop' of ssh://git.mysociety.org/data/git/public/alaveteli into rails-3-develop
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb5
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