Sha256: b2caf30fe3ccdc2646d4af69c5bde8c7113d1611d92ae365e2b2e2b67e17c65e

Contents?: true

Size: 763 Bytes

Versions: 13

Compression:

Stored size: 763 Bytes

Contents

require 'spec_helper'

describe 'Locale select' do
  let(:a_page) { FactoryGirl.create(:public_page) }
  before do
    allow(Alchemy::I18n).to receive(:translation_files).and_return ['alchemy.kl.yml', 'alchemy.jp.yml', 'alchemy.cz.yml']
    authorize_as_admin
  end

  it "contains all locales in a selectbox" do
    visit admin_dashboard_path
    expect(page).to have_select('change_locale', options: ['Kl', 'Jp', 'Cz'])
  end

  context 'when having available_locales set for Alchemy::I18n' do
    before do
      allow(Alchemy::I18n).to receive(:available_locales).and_return [:jp, :cz]
    end

    it "provides only that locales" do
      visit admin_dashboard_path
      expect(page).to have_select('change_locale', options: ['Jp', 'Cz'])
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
alchemy_cms-3.1.3 spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.2.0.beta spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.1.1 spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.1.0 spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.1.0.rc3 spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.1.0.rc2 spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.1.0.rc1 spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.1.0.beta6 spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.1.0.beta5 spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.1.0.beta4 spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.1.0.beta3 spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.1.0.beta2 spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.1.0.beta1 spec/features/admin/locale_select_feature_spec.rb