diff options
Diffstat (limited to 'spec/lib/gitlab/i18n_spec.rb')
-rw-r--r-- | spec/lib/gitlab/i18n_spec.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/lib/gitlab/i18n_spec.rb b/spec/lib/gitlab/i18n_spec.rb index b752d89bf0d..ee92831922d 100644 --- a/spec/lib/gitlab/i18n_spec.rb +++ b/spec/lib/gitlab/i18n_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::I18n do +RSpec.describe Gitlab::I18n, feature_category: :internationalization do let(:user) { create(:user, preferred_language: :es) } describe '.selectable_locales' do @@ -47,4 +47,19 @@ RSpec.describe Gitlab::I18n do expect(::I18n.locale).to eq(:en) end end + + describe '.pluralisation_rule' do + context 'when overridden' do + before do + # Internally, FastGettext sets + # Thread.current[:fast_gettext_pluralisation_rule]. + # Our patch patches `FastGettext.pluralisation_rule` instead. + FastGettext.pluralisation_rule = :something + end + + it 'returns custom definition regardless' do + expect(FastGettext.pluralisation_rule).to eq(Gitlab::I18n::Pluralization) + end + end + end end |