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.40.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.39.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.38.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.37.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.36.2 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.36.1 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.36.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.35.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.34.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.33.1 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.33.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.32.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.31.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.30.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.29.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.28.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.27.1 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.27.0 spec/helpers/blacklight/suggest_helper_behavior_spec.rb
blacklight-7.26.1 spec/helpers/blacklight/suggest_helper_behavior_spec.rb