Sha256: 02799448f25ed76c7ed2bbe399ebec1a545a26253013633c9487e248e16f84bd

Contents?: true

Size: 973 Bytes

Versions: 74

Compression:

Stored size: 973 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Blacklight::DefaultComponentConfiguration do
  subject do
    Class.new do
      include Blacklight::Configurable
      include Blacklight::DefaultComponentConfiguration

      def some_existing_action
        1
      end
    end
  end

  before do
    allow(Deprecation).to receive(:warn)
  end

  describe ".add_show_tools_partial" do
    it "defines an action method" do
      subject.blacklight_config.add_show_tools_partial :xyz
      expect(subject.new).to respond_to :xyz
    end

    it "does not replace an existing method" do
      subject.blacklight_config.add_show_tools_partial :some_existing_action
      expect(subject.new.some_existing_action).to eq 1
    end

    it "allows the configuration to opt out of creating a method" do
      subject.blacklight_config.add_show_tools_partial :some_missing_action, define_method: false
      expect(subject.new).not_to respond_to :some_missing_action
    end
  end
end

Version data entries

74 entries across 74 versions & 2 rubygems

Version Path
blacklight-7.40.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.39.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.38.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.37.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.36.2 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.36.1 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.36.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.35.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.34.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.33.1 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.33.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.32.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.31.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.30.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.29.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.28.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.27.1 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.27.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-7.26.1 spec/controllers/blacklight/catalog/component_configuration_spec.rb