闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
585 B

  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe SettingsHelper do
  4. describe 'the HUMAN_LOCALES constant' do
  5. it 'has the same number of keys as I18n locales exist' do
  6. options = I18n.available_locales
  7. expect(described_class::HUMAN_LOCALES.keys).to eq(options)
  8. end
  9. end
  10. describe 'human_locale' do
  11. it 'finds the human readable local description from a key' do
  12. # Ensure the value is as we expect
  13. expect(described_class::HUMAN_LOCALES[:en]).to eq('English')
  14. expect(helper.human_locale(:en)).to eq('English')
  15. end
  16. end
  17. end