Fix flaky spec for translations

This spec was causing a side effect on another spec[2], making it fail 😌

I think it was because no translation had been called yet, in the failing spec, and so the the i18n backend translations had not been initialized, and was always returning empty translations for any locale. This might have been due to tampering with translations in the this newly introduced spec.

By forcing translations to load after this new spec, the other spec passes again

[2] https://github.com/AyuntamientoMadrid/consul/blob/master/spec/features/localization_spec.rb#L20
This commit is contained in:
voodoorai2000
2018-10-10 12:47:40 +02:00
parent 710e5ae965
commit ccd342bb51

View File

@@ -13,6 +13,7 @@ describe LocalesHelper do
after do
I18n.backend.reload!
I18n.enforce_available_locales = default_enforce
I18n.backend.send(:init_translations)
end
it "returns the language name in i18n.language.name translation" do