Sha256: d45b92ab894cdb601faff8eda93d08a41641d0958f050a39827ba82f97023b5f

Contents?: true

Size: 867 Bytes

Versions: 31

Compression:

Stored size: 867 Bytes

Contents

# frozen_string_literal: true

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

      def some_existing_action
        1
      end
    end
  end

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

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

    it "should allow the configuration to opt out of creating a method" do
      subject.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

31 entries across 31 versions & 1 rubygems

Version Path
blacklight-6.25.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.24.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.23.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.22.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.21.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.20.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.19.2 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.19.1 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.19.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.18.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.17.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.16.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.15.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.14.1 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.14.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.13.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.12.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.11.2 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.11.1 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.11.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb