diff options
author | Robin Houston <robin@lenny.robin> | 2011-06-10 10:30:02 +0100 |
---|---|---|
committer | Robin Houston <robin@lenny.robin> | 2011-06-10 10:30:02 +0100 |
commit | c70f7b8e0ff11bc1ededfaa70eb1e775ef97453e (patch) | |
tree | 7b945516569e73ee80e682c41e0178ed3ddafbec | |
parent | 30b6614247917c66eddc5511647ab4f774229023 (diff) |
Since some of the tests rely on the availability of the "es" locale, we override the FastGettext.default_available_locales when testing to make sure it is available.
-rw-r--r-- | config/environment.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/config/environment.rb b/config/environment.rb index 6c030287d..732be8d07 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -117,8 +117,13 @@ end # fallback locale and available locales I18n.default_locale = :en -available_locales = MySociety::Config.get('AVAILABLE_LOCALES', 'en') -FastGettext.default_available_locales = available_locales.split(/ /) +if ENV["RAILS_ENV"] == "test" + # The tests assume that the "en" and "es" locales are available + FastGettext.default_available_locales = ["en", "es"] +else + available_locales = MySociety::Config.get('AVAILABLE_LOCALES', 'en') + FastGettext.default_available_locales = available_locales.split() +end # Load monkey patches and other things from lib/ require 'tmail_extensions.rb' |