From fc72ff2cd599109cabae8041e050e10302e9ea91 Mon Sep 17 00:00:00 2001 From: Jeremy Walker Date: Wed, 28 Oct 2026 21:34:15 +0900 Subject: [PATCH] Reload I18n after a test pins the available locales Co-Authored-By: Claude Opus 5.5 --- test/test_helper.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/test_helper.rb b/test/test_helper.rb index f246e995cf..a97ac6d081 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -234,6 +234,11 @@ def with_available_locales(*locales) ensure I18n.config.available_locales = Rails.application.config.i18n.available_locales I18n.unstub(:available_locales) + + # I18n only stores translations for available locales, so a reload inside the + # block (with_published_translations does one) leaves the backend without + # every other served locale. Reloading here brings them all back. + I18n.reload! end # e.g. with_published_translations(hu: { backend: { greeting: "Szia" } })