about summary refs log tree commit diff
path: root/spec/helpers/languages_helper_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/languages_helper_spec.rb')
-rw-r--r--spec/helpers/languages_helper_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/helpers/languages_helper_spec.rb b/spec/helpers/languages_helper_spec.rb
new file mode 100644
index 000000000..6db617824
--- /dev/null
+++ b/spec/helpers/languages_helper_spec.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe LanguagesHelper do
+  describe 'the HUMAN_LOCALES constant' do
+    it 'includes all I18n locales' do
+      expect(described_class::HUMAN_LOCALES.keys).to include(*I18n.available_locales)
+    end
+  end
+
+  describe 'human_locale' do
+    it 'finds the human readable local description from a key' do
+      expect(helper.human_locale(:en)).to eq('English')
+    end
+  end
+end