-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[3100-highlight] When no highlighted field is available fall back int…
…o the field value. Co-authored-by: Jane Sandberg <[email protected]> Co-authored-by: Vickie Karasic <[email protected]>
- Loading branch information
1 parent
157dd87
commit 1fafe70
Showing
2 changed files
with
30 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# 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 |