Sha256: 66969e38546198ddba2b76e2c182180eb81dc692c22c693a5b7b76c13aaf7e2a

Contents?: true

Size: 566 Bytes

Versions: 74

Compression:

Stored size: 566 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Blacklight::Configuration::Field do
  subject { described_class.new(key: key, label: label) }

  let(:key) { 'some_key' }
  let(:label) { 'some label' }

  describe '#display_label' do
    it "looks up the label to display for the given document and field" do
      allow(I18n).to receive(:t).with(:"blacklight.search.fields.my_context.some_key", default: [:"blacklight.search.fields.some_key", label, subject.default_label]).and_return('x')
      expect(subject.display_label('my_context')).to eq 'x'
    end
  end
end

Version data entries

74 entries across 74 versions & 2 rubygems

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