spec/models/blacklight/solr/search_builder_spec.rb in blacklight-8.1.0 vs spec/models/blacklight/solr/search_builder_spec.rb in blacklight-8.2.0
- old
+ new
@@ -333,10 +333,11 @@
# The tests below expect pre-solr-7.2 queries with local params
blacklight_config.search_fields['subject'].solr_local_parameters = {
qf: '$subject_qf',
pf: '$subject_pf'
}
+ blacklight_config.search_fields['subject'].clause_params = nil
end
it "looks up qt from field definition" do
expect(subject[:qt]).to eq "search"
end
@@ -371,9 +372,21 @@
# the LocalParams are really there
subject[:q] =~ /^\{!([^}]+)\}/
key_value_pairs = Regexp.last_match(1).split
expect(key_value_pairs).to include("pf=$subject_pf")
expect(key_value_pairs).to include("qf=$subject_qf")
+ end
+
+ context 'when subject field uses JSON query DSL' do
+ before do
+ blacklight_config.search_fields['subject'].clause_params = {
+ edismax: {}
+ }
+ end
+
+ it "includes spellcheck.q, without LocalParams" do
+ expect(subject["spellcheck.q"]).to eq "wome"
+ end
end
end
describe "solr json query parameters from the fielded search" do
let(:user_params) { subject_search_params }