spec/models/blacklight/solr/search_builder_spec.rb in blacklight-5.16.0 vs spec/models/blacklight/solr/search_builder_spec.rb in blacklight-5.16.1
- old
+ new
@@ -1,8 +1,8 @@
require 'spec_helper'
-describe Blacklight::Solr::SearchBuilder do
+describe Blacklight::Solr::SearchBuilderBehavior do
let(:single_facet) { { format: 'Book' } }
let(:multi_facets) { { format: 'Book', language_facet: 'Tibetan' } }
let(:mult_word_query) { 'tibetan history' }
let(:subject_search_params) { { commit: "search", search_field: "subject", action: "index", controller: "catalog", rows: "10", q: "wome" } }
@@ -11,17 +11,22 @@
let(:user_params) { Hash.new }
let(:context) { CatalogController.new }
before { allow(context).to receive(:blacklight_config).and_return(blacklight_config) }
- let(:search_builder) { described_class.new(method_chain, context) }
+ let(:search_builder_class) do
+ Class.new(Blacklight::SearchBuilder) do
+ include Blacklight::Solr::SearchBuilderBehavior
+ end
+ end
+ let(:search_builder) { search_builder_class.new(method_chain, context) }
subject { search_builder.with(user_params) }
context "with default processor chain" do
- subject { described_class.new true, context }
+ subject { search_builder_class.new true, context }
it "should use the class-level default_processor_chain" do
- expect(subject.processor_chain).to eq described_class.default_processor_chain
+ expect(subject.processor_chain).to eq search_builder_class.default_processor_chain
end
end
context "with a complex parameter environment" do
subject { search_builder.with(user_params).processed_parameters }