Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport] Fix flaky localization specs #3096

Merged
merged 1 commit into from
Dec 11, 2018

Conversation

Not doing so might cause the following test to use translations for
only one locale. This scenario happens if the previous test executes
I18n.reload!, which resets I18n.config.backend's "@translations"
instance variable.

So, the sequence could be as follows:

1. The previous tests sets `@translations = nil`
2. This test stubs `available_locales` to `[:en]`
3. `@translations` gets only translations for `en`
4. The following test doesn't find translations for Spanish and fails
@javierm javierm changed the title Reload I18n after stubbing available locales [Backport] Fix flaky localization specs Dec 10, 2018
@javierm javierm merged commit db53be7 into master Dec 11, 2018
@javierm javierm deleted the backport-1630-fix_flaky_localization_specs branch December 11, 2018 18:56
@javierm javierm self-assigned this Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky specs: Localization Changing the locale and Available locales appear in the locale switcher
2 participants