From 3976b2f4f248ac5d4f35aafe29a31d46e0c20b2f Mon Sep 17 00:00:00 2001 From: voodoorai2000 Date: Wed, 10 Oct 2018 11:33:48 +0200 Subject: [PATCH] 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 --- spec/i18n_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/i18n_spec.rb b/spec/i18n_spec.rb index 7fb59edde..e1d60e2fc 100644 --- a/spec/i18n_spec.rb +++ b/spec/i18n_spec.rb @@ -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")