Sha256: 2a6e13b81f6ed8e85176f7ee3dcc40d6740873db2306138885f51c53d2a4c750

Contents?: true

Size: 863 Bytes

Versions: 17

Compression:

Stored size: 863 Bytes

Contents

require 'spec_helper'

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

17 entries across 17 versions & 1 rubygems

Version Path
blacklight-5.19.2 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-5.19.1 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-5.19.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-5.18.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-5.17.2 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.0.0.pre5 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-5.17.1 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-5.17.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.0.0.pre4 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-5.16.4 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.0.0.pre3 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-5.16.3 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-5.16.2 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-5.16.1 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.0.0.pre2 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-6.0.0.pre1 spec/controllers/blacklight/catalog/component_configuration_spec.rb
blacklight-5.16.0 spec/controllers/blacklight/catalog/component_configuration_spec.rb