-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable fulltext search on the Carnegie custom site (DLC-1140)
- Loading branch information
Showing
3 changed files
with
42 additions
and
2 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
39 changes: 39 additions & 0 deletions
39
spec/unit/dcv/configurators/carnegie_blacklight_configurator_spec.rb
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,39 @@ | ||
# frozen_string_literal: true | ||
require 'rails_helper' | ||
|
||
describe Dcv::Configurators::CarnegieBlacklightConfigurator do | ||
let(:config) do | ||
Blacklight::Configuration.new | ||
end | ||
let(:configurator) { Class.new { include Dcv::Configurators::BaseBlacklightConfigurator }.new } | ||
|
||
describe 'fulltext search configuration' do | ||
context 'flag is default' do | ||
before do | ||
described_class.configure(config) | ||
end | ||
|
||
it 'only includes the field values in facet.field' do | ||
expect(config.search_fields['fulltext_tesim']).to be_a Blacklight::Configuration::SearchField | ||
end | ||
end | ||
context 'flag is true' do | ||
before do | ||
described_class.configure(config, fulltext: true) | ||
end | ||
|
||
it 'only includes the field values in facet.field' do | ||
expect(config.search_fields['fulltext_tesim']).to be_a Blacklight::Configuration::SearchField | ||
end | ||
end | ||
context 'flag is false, as per centennial site' do | ||
before do | ||
described_class.configure(config, fulltext: false) | ||
end | ||
|
||
it 'only includes the field values in facet.field' do | ||
expect(config.search_fields['fulltext_tesim']).to be_nil | ||
end | ||
end | ||
end | ||
end |