Sha256: 33659c8eced7be10f5f9efadc29b8d466295fd6b2dbb2cef8c2d890dd260c83a

Contents?: true

Size: 630 Bytes

Versions: 16

Compression:

Stored size: 630 Bytes

Contents

require 'spec_helper'

describe Qbrick::Cms::AdminHelper, type: :helper do
  describe '#render_language_switch?' do
    context 'when there is one language' do
      before do
        allow(I18n).to receive(:available_locales).and_return([:de])
      end

      it 'returns false' do
        expect(helper.render_language_switch?).to be_falsey
      end
    end

    context 'when there are multiple languages' do
      before do
        allow(I18n).to receive(:available_locales).and_return([:de, :en])
      end

      it 'returns true' do
        expect(helper.render_language_switch?).to be_truthy
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
qbrick-2.7.1 spec/helpers/qbrick/cms/admin_helper_spec.rb
qbrick-2.7 spec/helpers/qbrick/cms/admin_helper_spec.rb
qbrick-2.6.10 spec/helpers/qbrick/cms/admin_helper_spec.rb
qbrick-2.6.9 spec/helpers/qbrick/cms/admin_helper_spec.rb
qbrick-2.6.8 spec/helpers/qbrick/cms/admin_helper_spec.rb
qbrick-2.6.7 spec/helpers/qbrick/cms/admin_helper_spec.rb
qbrick-2.6.6 spec/helpers/qbrick/cms/admin_helper_spec.rb
qbrick-2.6.5 spec/helpers/qbrick/cms/admin_helper_spec.rb
qbrick-2.6.4 spec/helpers/qbrick/cms/admin_helper_spec.rb
qbrick-2.6.3 spec/helpers/qbrick/cms/admin_helper_spec.rb
qbrick-2.6.2 spec/helpers/qbrick/cms/admin_helper_spec.rb
qbrick-2.6.1 spec/helpers/qbrick/cms/admin_helper_spec.rb
qbrick-2.6.0 spec/helpers/qbrick/cms/admin_helper_spec.rb
qbrick-2.5.2 spec/helpers/qbrick/cms/admin_helper_spec.rb
qbrick-2.5.1 spec/helpers/qbrick/cms/admin_helper_spec.rb
qbrick-2.5.0 spec/helpers/qbrick/cms/admin_helper_spec.rb