Sha256: 744cd7f71d0fb5f3c7316ecca7573c818cd22868b9ab7bbc51325fe3f8649de8

Contents?: true

Size: 705 Bytes

Versions: 13

Compression:

Stored size: 705 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Blacklight::FieldRetriever, api: true do
  let(:service) { described_class.new(document, blacklight_field_config) }

  let(:blacklight_field_config) { Blacklight::Configuration::Field.new(field: 'author_field', highlight: true) }
  let(:document) { SolrDocument.new({ 'id' => 'doc1', 'title_field' => 'doc1 title', 'author_field' => 'author_someone' }, 'highlighting' => { 'doc1' => { 'title_tsimext' => ['doc <em>1</em>'] } }) }
  let(:view_context) { {} }

  context "highlighting" do
    describe '#fetch' do
      it "retrieves an author even if it's not highlighted" do
        expect(service.fetch).to eq(['author_someone'])
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
blacklight-7.40.0 spec/services/blacklight/field_retriever_spec.rb
blacklight-7.39.0 spec/services/blacklight/field_retriever_spec.rb
blacklight-7.38.0 spec/services/blacklight/field_retriever_spec.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/spec/services/blacklight/field_retriever_spec.rb
blacklight-8.2.2 spec/services/blacklight/field_retriever_spec.rb
blacklight-8.2.1 spec/services/blacklight/field_retriever_spec.rb
blacklight-8.2.0 spec/services/blacklight/field_retriever_spec.rb
blacklight-7.37.0 spec/services/blacklight/field_retriever_spec.rb
blacklight-7.36.2 spec/services/blacklight/field_retriever_spec.rb
blacklight-7.36.1 spec/services/blacklight/field_retriever_spec.rb
blacklight-7.36.0 spec/services/blacklight/field_retriever_spec.rb
blacklight-7.35.0 spec/services/blacklight/field_retriever_spec.rb
blacklight-8.1.0 spec/services/blacklight/field_retriever_spec.rb