Sha256: b320ecf2f2a19a09fa6dc7d2589fa6a72e191547f9c2cc2afc14bba6c8c804d1

Contents?: true

Size: 828 Bytes

Versions: 22

Compression:

Stored size: 828 Bytes

Contents

# frozen_string_literal: true

describe Spotlight::NavbarHelper, type: :helper do
  describe '#should_render_search_bar?' do
    before do
      allow(helper).to receive_messages(current_exhibit: nil)
      allow(helper).to receive_messages(exhibit_masthead?: true)
    end

    it 'returns false when there is no exhibit context' do
      expect(helper).not_to be_should_render_spotlight_search_bar
    end

    it 'returns true if searchable' do
      allow(helper).to receive_messages(current_exhibit: double(searchable?: true))
      expect(helper).to be_should_render_spotlight_search_bar
    end

    it 'returns false if currently under an "Exhibity" browse category' do
      allow(helper).to receive_messages(exhibit_masthead?: false)
      expect(helper).not_to be_should_render_spotlight_search_bar
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
blacklight-spotlight-3.4.0 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.3.0 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.2.0 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.1.0 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.0.3 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.0.2 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.0.1 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.0.0 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.0.0.rc6 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.0.0.rc5 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.0.0.rc4 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.0.0.rc3 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.0.0.rc2 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.0.0.rc1 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.0.0.alpha.10 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.0.0.alpha.9 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.0.0.alpha.8 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.0.0.alpha.7 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.0.0.alpha.6 spec/helpers/spotlight/navbar_helper_spec.rb
blacklight-spotlight-3.0.0.alpha.5 spec/helpers/spotlight/navbar_helper_spec.rb