Sha256: a9bc9c77a9e0362ee127167a07ad1292d7f0d9424791c4590a13511dbf259f3f

Contents?: true

Size: 1.25 KB

Versions: 74

Compression:

Stored size: 1.25 KB

Contents

# frozen_string_literal: true

RSpec.describe Blacklight::SuggestHelperBehavior do
  before do
    allow(helper).to receive(:blacklight_config).and_return(blacklight_config)
    expect(Deprecation).to receive(:warn)
  end

  describe '#autocomplete_enabled?' do
    describe 'with autocomplete config' do
      let(:blacklight_config) do
        Blacklight::Configuration.new.configure do |config|
          config.autocomplete_enabled = true
          config.autocomplete_path = 'suggest'
        end
      end

      it 'is enabled' do
        expect(helper.autocomplete_enabled?).to be true
      end
    end

    describe 'without disabled config' do
      let(:blacklight_config) do
        Blacklight::Configuration.new.configure do |config|
          config.autocomplete_enabled = false
          config.autocomplete_path = 'suggest'
        end
      end

      it 'is disabled' do
        expect(helper.autocomplete_enabled?).to be false
      end
    end

    describe 'without path config' do
      let(:blacklight_config) do
        Blacklight::Configuration.new.configure do |config|
          config.autocomplete_enabled = true
        end
      end

      it 'is disabled' do
        expect(helper.autocomplete_enabled?).to be false
      end
    end
  end
end

Version data entries

74 entries across 74 versions & 2 rubygems

Version Path
blacklight-7.18.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.17.2 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.17.1 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.17.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.16.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.15.2 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.15.1 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.15.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.14.1 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.14.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.13.2 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.13.1 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.13.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.12.1 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.12.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.11.1 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.10.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.9.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.8.1 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.8.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb