Fix pluralization spec when using different default locale

This spec was failing due to using :es as the default_locale in application.rb[1], but using :en as the default_locale in the test environment[2]

The fallback rules where getting a little confused and not including the default locale, for the test environment, in the fallback rules

With this commit we are making sure that rule is created, as it would in a production environment that uses the default_locale in application.rb

[1] https://github.com/AyuntamientoMadrid/consul/blob/master/config/application.rb#L22

[2] https://github.com/AyuntamientoMadrid/consul/blob/master/spec/rails_helper.rb#L15
This commit is contained in:
voodoorai2000
2018-10-10 11:33:48 +02:00
committed by decabeza
parent 2c34a8b4e2
commit bc0479f9c3

View File

@@ -44,6 +44,7 @@ describe 'I18n' do
I18n.enforce_available_locales = false
I18n.locale = :zz
I18n.fallbacks[:zz] << I18n.default_locale
expect(I18n.t("test_plural", count: 0)).to eq("No comments")
expect(I18n.t("test_plural", count: 1)).to eq("1 comment")