Sha256: 28b13c7d0c776ee4281a344f4c5dc56f6d1cbbde6b61a37d5dcccc32e6003aa2

Contents?: true

Size: 1 KB

Versions: 19

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'

describe Blacklight::Facet do
  subject do
    Class.new do
      include Blacklight::Facet
      attr_reader :blacklight_config

      def initialize blacklight_config
        @blacklight_config = blacklight_config
      end
    end.new(blacklight_config)
  end

  let(:blacklight_config) { Blacklight::Configuration.new }

  describe "#facet_configuration_for_field" do
    it "should look up fields by key" do
      blacklight_config.add_facet_field 'a'
      expect(subject.facet_configuration_for_field('a')).to eq blacklight_config.facet_fields['a']
    end

    it "should look up fields by field name" do
      blacklight_config.add_facet_field 'a', field: 'b'
      expect(subject.facet_configuration_for_field('b')).to eq blacklight_config.facet_fields['a']
    end

    it "should support both strings and symbols" do
      blacklight_config.add_facet_field 'a', field: :b
      expect(subject.facet_configuration_for_field('b')).to eq blacklight_config.facet_fields['a']
    end
  end

end

Version data entries

19 entries across 19 versions & 1 rubygems

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