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.7.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.6.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.5.1 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.5.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.4.2 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.4.1 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.4.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.3.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.2.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.1.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.1.0.alpha spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.0.1 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.0.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.0.0.rc2 spec/helpers/blacklight/suggest_helper_behavior_spec.rb