Files
openfoodnetwork/.env.test
Maikel Linke 63988fff4f Configure test locales like other envs
The locale config is set in application.rb from environment variables
already. We don't need to repeat that logic in test.rb. And because it
was outdated, the language switcher was actually broken in the test
environment. We did have an English selector for the fallback `en` even
though we were already displaying English as en_TST. And after
switchting to Spanish, we could switch back because en_TST was not in
the available locales.

I now fixed the test with the right assumption and the config to solve
the problem.
2026-03-18 14:49:15 +11:00

40 lines
1.4 KiB
Plaintext

# ENV vars for the test environment
# Override locally with `.env.test.local`
# Test env specific variables
#
# Adjust this to your computer. When you start test-driven development, you may
# want to reduce this value to avoid waiting for a test that you expect to fail.
CAPYBARA_MAX_WAIT_TIME="10"
# General app specific variables
# Locale for translation. Using a locale other than `en` tests the
# successful fallback to `en`.
LOCALE="en_TST"
# For multilingual - ENV doesn't have array so pass it as string with commas
AVAILABLE_LOCALES="en_TST,es,pt"
OFN_REDIS_JOBS_URL="redis://localhost:6379/2"
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
STRIPE_INSTANCE_SECRET_KEY="bogus_key"
STRIPE_CUSTOMER="bogus_customer"
STRIPE_ACCOUNT="bogus_account"
STRIPE_CLIENT_ID="bogus_client_id"
SITE_URL="test.host"
# OIDC Settings for DFC authentication
# Find secrets in BitWarden.
# To get a refresh token: log into the OIDC provider, connect your OFN user to it at /admin/oidc_settings, then copy the token from the database:
# ./bin/rails runner 'puts "OPENID_REFRESH_TOKEN=\"#{OidcAccount.last.refresh_token}\""'
OPENID_APP_ID="test-provider"
OPENID_APP_SECRET="dummy-openid-app-secret-token"
OPENID_REFRESH_TOKEN="dummy-refresh-token"
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY="test_primary_key"
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY="test_deterministic_key"
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT="test_derivation_salt"