Merge pull request #13210 from dacook/test-locale

Ensure tests run with specified locale
This commit is contained in:
Maikel
2025-03-18 09:57:25 +11:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -1,7 +1,8 @@
# ENV vars for the test environment
# Override locally with `.env.test.local`
# Locale for translation.
# Locale for translation. Using a locale other than `en` tests the
# successful fallback to `en`.
LOCALE="en_TST"
OFN_REDIS_JOBS_URL="redis://localhost:6379/2"

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.