|
371 | 371 | # TODO: maybe eventually check other types of solr requests
|
372 | 372 | # more like this
|
373 | 373 | # nearby on shelf
|
374 |
| - it "raises a Blacklight exception if RSolr can't connect to the Solr instance" do |
375 |
| - allow(blacklight_solr).to receive(:send_and_receive).and_raise(Errno::ECONNREFUSED) |
376 |
| - expect { service.repository.search(params: {}) }.to raise_exception(/Unable to connect to Solr instance/) |
| 374 | + # |
| 375 | + context "when RSolr can't connect to the Solr instance", :solr do |
| 376 | + it "raises a Blacklight exception" do |
| 377 | + allow(blacklight_solr).to receive(:send_and_receive).and_raise(Errno::ECONNREFUSED) |
| 378 | + expect { service.repository.search(params: {}) }.to raise_exception(/Unable to connect to Solr instance/) |
| 379 | + end |
377 | 380 | end
|
378 | 381 |
|
379 |
| - it "raises a Blacklight exception if RSolr raises a timeout error connecting to Solr instance" do |
380 |
| - rsolr_timeout = RSolr::Error::Timeout.new(nil, nil) |
381 |
| - allow(rsolr_timeout).to receive(:to_s).and_return("mocked RSolr timeout") |
| 382 | + context 'when RSolr raises a timeout error connecting to Solr instance', :solr do |
| 383 | + it "raises a Blacklight exception" do |
| 384 | + rsolr_timeout = RSolr::Error::Timeout.new(nil, nil) |
| 385 | + allow(rsolr_timeout).to receive(:to_s).and_return("mocked RSolr timeout") |
382 | 386 |
|
383 |
| - allow(blacklight_solr).to receive(:send_and_receive).and_raise(rsolr_timeout) |
384 |
| - expect { service.repository.search(params: {}) }.to raise_exception(Blacklight::Exceptions::RepositoryTimeout, /Timeout connecting to Solr instance/) |
| 387 | + allow(blacklight_solr).to receive(:send_and_receive).and_raise(rsolr_timeout) |
| 388 | + expect { service.repository.search(params: {}) }.to raise_exception(Blacklight::Exceptions::RepositoryTimeout, /Timeout connecting to Solr instance/) |
| 389 | + end |
385 | 390 | end
|
386 | 391 |
|
387 | 392 | describe "#previous_and_next_documents_for_search" do
|
|
0 commit comments