|
17 | 17 | let(:user_params) { {} } |
18 | 18 |
|
19 | 19 | let(:blacklight_config) { CatalogController.blacklight_config.deep_copy } |
20 | | - let(:blacklight_solr) { RSolr.connect(Blacklight.connection_config.except(:adapter)) } |
21 | 20 |
|
22 | 21 | let(:all_docs_query) { '' } |
23 | 22 | let(:no_docs_query) { 'zzzzzzzzzzzz' } |
24 | | - # f[format][]=Book&f[language_facet][]=English |
25 | 23 | let(:single_facet) { { format: 'Book' } } |
26 | 24 |
|
27 | 25 | before do |
28 | 26 | allow(service).to receive(:repository).and_return(repository) |
29 | | - service.repository.connection = blacklight_solr |
30 | 27 | end |
31 | 28 |
|
32 | 29 | describe '#search_builder_class' do |
|
51 | 48 | describe 'Search Results', :integration do |
52 | 49 | describe 'for a sample query returning results' do |
53 | 50 | let(:user_params) { { q: all_docs_query } } |
| 51 | + let(:blacklight_solr) { service.repository.connection } |
54 | 52 |
|
55 | 53 | it "uses the configured request handler" do |
56 | 54 | allow(blacklight_config).to receive(:default_solr_params).and_return(qt: 'custom_request_handler') |
|
372 | 370 | # TODO: maybe eventually check other types of solr requests |
373 | 371 | # more like this |
374 | 372 | # nearby on shelf |
375 | | - it "raises a Blacklight exception if RSolr can't connect to the Solr instance" do |
376 | | - allow(blacklight_solr).to receive(:send_and_receive).and_raise(Errno::ECONNREFUSED) |
377 | | - expect { service.repository.search(params: {}) }.to raise_exception(/Unable to connect to Solr instance/) |
378 | | - end |
379 | | - |
380 | | - it "raises a Blacklight exception if RSolr raises a timeout error connecting to Solr instance" do |
381 | | - rsolr_timeout = RSolr::Error::Timeout.new(nil, nil) |
382 | | - allow(rsolr_timeout).to receive(:to_s).and_return("mocked RSolr timeout") |
383 | | - |
384 | | - allow(blacklight_solr).to receive(:send_and_receive).and_raise(rsolr_timeout) |
385 | | - expect { service.repository.search(params: {}) }.to raise_exception(Blacklight::Exceptions::RepositoryTimeout, /Timeout connecting to Solr instance/) |
386 | | - end |
387 | 373 |
|
388 | 374 | describe "#previous_and_next_documents_for_search" do |
389 | 375 | let(:user_params) { { q: '', per_page: 100 } } |
|
0 commit comments