Sha256: 62db5aec09c12e039708968213bdea2204b111958817258dc37f7c1ff8df47a5

Contents?: true

Size: 543 Bytes

Versions: 8

Compression:

Stored size: 543 Bytes

Contents

# frozen_string_literal: true

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

  let(:key) { 'my_view' }
  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.view_title.my_view", default: [:"blacklight.search.view.my_view", label, nil, "My view"]).and_return('x')
      expect(subject.display_label(key)).to eq 'x'
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
blacklight-7.15.2 spec/lib/blacklight/configuration/view_config_spec.rb
blacklight-7.15.1 spec/lib/blacklight/configuration/view_config_spec.rb
blacklight-7.15.0 spec/lib/blacklight/configuration/view_config_spec.rb
blacklight-7.14.1 spec/lib/blacklight/configuration/view_config_spec.rb
blacklight-7.14.0 spec/lib/blacklight/configuration/view_config_spec.rb
blacklight-7.13.2 spec/lib/blacklight/configuration/view_config_spec.rb
blacklight-7.13.1 spec/lib/blacklight/configuration/view_config_spec.rb
blacklight-7.13.0 spec/lib/blacklight/configuration/view_config_spec.rb