Run tests with specified locale

We changed .env.test a while ago, but I just discovered it hadn't taken any effect because it was overwritten here. Now it's loaded from env var.
This commit is contained in:
David Cook
2025-03-13 11:56:16 +11:00
parent 1213455350
commit 1bbd6b58fd

View File

@@ -150,7 +150,8 @@ RSpec.configure do |config|
# Reset locale for all specs.
config.around(:each) do |example|
I18n.with_locale(:en_AU) { example.run }
locale = ENV.fetch('LOCALE', 'en_TST')
I18n.with_locale(locale) { example.run }
end
# Reset all feature toggles to prevent leaking.