Sha256: 44510fa2735294b043aaf52acff5400da7f4ab4f15f31ff5554a4bbef0b1e430

Contents?: true

Size: 1.85 KB

Versions: 9

Compression:

Stored size: 1.85 KB

Contents

# frozen_string_literal: true

RSpec.describe Blacklight::LayoutHelperBehavior do
  describe '#show_content_classes' do
    it 'returns a string of classes' do
      expect(helper.show_content_classes).to be_an String
      expect(helper.show_content_classes).to eq 'col-lg-9 show-document'
    end
  end

  describe '#show_sidebar_classes' do
    it 'returns a string of classes' do
      expect(helper.show_sidebar_classes).to be_an String
      expect(helper.show_sidebar_classes).to eq 'page-sidebar col-lg-3'
    end
  end

  describe '#main_content_classes' do
    it 'returns a string of classes' do
      expect(helper.main_content_classes).to be_an String
      expect(helper.main_content_classes).to eq 'col-lg-9'
    end
  end

  describe '#sidebar_classes' do
    it 'returns a string of classes' do
      expect(helper.sidebar_classes).to be_an String
      expect(helper.sidebar_classes).to eq 'page-sidebar col-lg-3'
    end
  end

  describe '#container_classes' do
    before do
      allow(view).to receive(:blacklight_config).and_return(config)
    end

    context 'when not full-width' do
      let(:config) { Blacklight::Configuration.new }

      it 'returns a string of classe(s)' do
        expect(helper.container_classes).to be_an String
        expect(helper.container_classes).to eq 'container'
      end
    end

    context 'when full-width' do
      let(:config) { Blacklight::Configuration.new(full_width_layout: true) }

      it 'returns a string of classe(s)' do
        expect(helper.container_classes).to be_an String
        expect(helper.container_classes).to eq 'container-fluid'
      end
    end
  end

  describe '#html_tag_attributes' do
    before do
      allow(I18n).to receive(:locale).and_return('x')
    end

    it 'returns the current locale as the lang' do
      expect(helper.html_tag_attributes).to include lang: 'x'
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
blacklight-8.6.1 spec/helpers/blacklight/layout_helper_behavior_spec.rb
blacklight-7.40.0 spec/helpers/blacklight/layout_helper_behavior_spec.rb
blacklight-8.6.0 spec/helpers/blacklight/layout_helper_behavior_spec.rb
blacklight-8.5.1 spec/helpers/blacklight/layout_helper_behavior_spec.rb
blacklight-8.5.0 spec/helpers/blacklight/layout_helper_behavior_spec.rb
blacklight-7.39.0 spec/helpers/blacklight/layout_helper_behavior_spec.rb
blacklight-8.4.0 spec/helpers/blacklight/layout_helper_behavior_spec.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/spec/helpers/blacklight/layout_helper_behavior_spec.rb
blacklight-8.3.0 spec/helpers/blacklight/layout_helper_behavior_spec.rb