spec/services/blacklight/search_service_spec.rb in blacklight-8.2.2 vs spec/services/blacklight/search_service_spec.rb in blacklight-8.3.0

- old
+ new

@@ -6,20 +6,20 @@ # queries to solr such that it gets appropriate results. When a user does a search, # do we get data back from solr (i.e. did we properly configure blacklight code # to talk with solr and get results)? when we do a document request, does # blacklight code get a single document returned?) # -RSpec.describe Blacklight::SearchService, api: true do +RSpec.describe Blacklight::SearchService, :api do subject { service } let(:context) { { whatever: :value } } let(:service) { described_class.new(config: blacklight_config, user_params: user_params, **context) } let(:repository) { Blacklight::Solr::Repository.new(blacklight_config) } let(:user_params) { {} } let(:blacklight_config) { Blacklight::Configuration.new } - let(:copy_of_catalog_config) { ::CatalogController.blacklight_config.deep_copy } + let(:copy_of_catalog_config) { CatalogController.blacklight_config.deep_copy } let(:blacklight_solr) { RSolr.connect(Blacklight.connection_config.except(:adapter)) } let(:all_docs_query) { '' } let(:no_docs_query) { 'zzzzzzzzzzzz' } # f[format][]=Book&f[language_facet][]=English @@ -47,11 +47,11 @@ end end end # SPECS FOR SEARCH RESULTS FOR QUERY - describe 'Search Results', integration: true do + describe 'Search Results', :integration do let(:blacklight_config) { copy_of_catalog_config } describe 'for a sample query returning results' do let(:user_params) { { q: all_docs_query } } @@ -79,11 +79,11 @@ it "returns a grouped response" do expect(service.search_results).to be_a_kind_of Blacklight::Solr::Response::GroupResponse end end - describe "for a query returning multiple groups", integration: true do + describe "for a query returning multiple groups", :integration do let(:blacklight_config) { copy_of_catalog_config } let(:user_params) { { q: all_docs_query } } before do allow(subject).to receive_messages grouped_key_for_results: 'title_si' @@ -137,11 +137,11 @@ end end end # Search Results # SPECS FOR SEARCH RESULTS FOR FACETS - describe 'Facets in Search Results for All Docs Query', integration: true do + describe 'Facets in Search Results for All Docs Query', :integration do let(:blacklight_config) { copy_of_catalog_config } let(:user_params) { { q: all_docs_query } } before do (solr_response,) = service.search_results @@ -182,11 +182,11 @@ end end end # facet specs # SPECS FOR SEARCH RESULTS FOR PAGING - describe 'Paging', integration: true do + describe 'Paging', :integration do let(:blacklight_config) { copy_of_catalog_config } let(:user_params) { { q: all_docs_query } } it 'starts with first results by default' do (solr_response,) = service.search_results @@ -274,11 +274,11 @@ end end end # page specs # SPECS FOR SINGLE DOCUMENT REQUESTS - describe 'Get Document By Id', integration: true do + describe 'Get Document By Id', :integration do let(:doc_id) { '2007020969' } let(:bad_id) { 'redrum' } before do @document = service.fetch(doc_id) @@ -297,11 +297,11 @@ it 'has the expected value in the id field' do expect(@document.id).to eq doc_id end end - describe 'Get multiple documents By Id', integration: true do + describe 'Get multiple documents By Id', :integration do let(:doc_id) { '2007020969' } let(:bad_id) { 'redrum' } let(:response) { service.fetch([doc_id]) } before do @@ -316,10 +316,10 @@ expect(response.first['format']).to eq ['Book'] end end # SPECS FOR SPELLING SUGGESTIONS VIA SEARCH - describe "Searches should return spelling suggestions", integration: true do + describe "Searches should return spelling suggestions", :integration do context "for just-poor-enough-query term" do let(:user_params) { { q: 'boo' } } it 'has (multiple) spelling suggestions' do (solr_response,) = service.search_results