Sha256: 201ca40976c06eb1be9d6ac1a2564d2db9b2f386c0e9d3cc57110c601f8a0159

Contents?: true

Size: 931 Bytes

Versions: 6

Compression:

Stored size: 931 Bytes

Contents

require 'spec_helper'

module Alchemy
  describe I18n do
    describe '.translation_files' do
      subject { I18n.translation_files }
      it      { should be_a Array }
      it      { should be_any { |f| f =~ /alchemy.*.yml/ } }
    end

    describe '.available_locales' do
      subject { I18n.available_locales }
      before  { I18n.stub(translation_files: ['alchemy.kl.yml']) }
      it      { should be_a Array }
      it      { should include :kl }

      context 'when locales are already set in @@available_locales' do
        before { I18n.class_variable_set(:@@available_locales, [:kl, :jp]) }
        it     { should eq([:kl, :jp]) }
      end
    end

    describe '.available_locales=' do
      it "assigns the given locales to @@available_locales" do
        I18n.available_locales = [:kl, :nl, :cn]
        expect(I18n.class_variable_get(:@@available_locales)).to eq([:kl, :nl, :cn])
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
alchemy_cms-3.0.4 spec/libraries/i18n_spec.rb
alchemy_cms-3.0.3 spec/libraries/i18n_spec.rb
alchemy_cms-3.0.2 spec/libraries/i18n_spec.rb
alchemy_cms-3.0.1 spec/libraries/i18n_spec.rb
alchemy_cms-3.0.0 spec/libraries/i18n_spec.rb
alchemy_cms-3.0.0.rc8 spec/libraries/i18n_spec.rb