aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/environment.rb9
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'