summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/i18n_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 15:44:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 15:44:42 +0000
commit4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch)
tree5423a1c7516cffe36384133ade12572cf709398d /spec/lib/gitlab/i18n_spec.rb
parente570267f2f6b326480d284e0164a6464ba4081bc (diff)
downloadgitlab-ce-4555e1b21c365ed8303ffb7a3325d773c9b8bf31.tar.gz
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'spec/lib/gitlab/i18n_spec.rb')
-rw-r--r--spec/lib/gitlab/i18n_spec.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/spec/lib/gitlab/i18n_spec.rb b/spec/lib/gitlab/i18n_spec.rb
index ee10739195a..aae4a13bd73 100644
--- a/spec/lib/gitlab/i18n_spec.rb
+++ b/spec/lib/gitlab/i18n_spec.rb
@@ -3,13 +3,18 @@
require 'spec_helper'
RSpec.describe Gitlab::I18n do
- let(:user) { create(:user, preferred_language: 'es') }
+ let(:user) { create(:user, preferred_language: :es) }
describe '.selectable_locales' do
- it 'does not return languages that should not be available in the UI' do
- Gitlab::I18n::NOT_AVAILABLE_IN_UI.each do |language|
- expect(described_class.selectable_locales).not_to include(language)
- end
+ include StubLanguagesTranslationPercentage
+
+ it 'does not return languages with low translation levels' do
+ stub_languages_translation_percentage(pt_BR: 0, en: 100, es: 65)
+
+ expect(described_class.selectable_locales).to eq({
+ 'en' => 'English',
+ 'es' => 'Spanish - espaƱol'
+ })
end
end