spec/models/blacklight/solr/search_builder_spec.rb in blacklight-8.0.1 vs spec/models/blacklight/solr/search_builder_spec.rb in blacklight-8.1.0
- old
+ new
@@ -404,9 +404,17 @@
end
it 'includes addtional clause parameters for the field' do
expect(subject.dig(:json, :query, :bool, :must, 0, :edismax)).to include another: :parameter
end
+
+ context 'with an empty search' do
+ let(:subject_search_params) { { commit: "search", search_field: "subject", action: "index", controller: "catalog", rows: "10", q: nil } }
+
+ it 'does not add nil query value clauses to json query' do
+ expect(subject).not_to have_key :json
+ end
+ end
end
describe "sorting" do
context 'when the user has not provided a value' do
it 'sends the default sort parameter to solr' do