Sha256: ae906d9e15ffe44c34efca86410fabd0c222f3826f8ec8032763364d724d0dd7

Contents?: true

Size: 701 Bytes

Versions: 6

Compression:

Stored size: 701 Bytes

Contents

require 'spec_helper'

describe 'Locale select' do
  let(:a_page) { FactoryGirl.create(:public_page) }
  before do
    Alchemy::I18n.stub(translation_files: ['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 { Alchemy::I18n.stub(available_locales: [:jp, :cz]) }
    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

6 entries across 6 versions & 1 rubygems

Version Path
alchemy_cms-3.0.4 spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.0.3 spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.0.2 spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.0.1 spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.0.0 spec/features/admin/locale_select_feature_spec.rb
alchemy_cms-3.0.0.rc8 spec/features/admin/locale_select_feature_spec.rb