Skip to content

Commit

Permalink
Fix rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
Genia Kazymova committed Nov 4, 2024
1 parent c87e8c1 commit eb9d42e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 16 deletions.
4 changes: 2 additions & 2 deletions spec/helpers/catalog_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
end

it 'is bookmarked if the document is in the bookmarks' do
expect(helper.bookmarked?(bookmarked_document)).to eq true
expect(helper.bookmarked?(bookmarked_document)).to be true
end

it 'is not bookmarked if the document is not in the bookmarks' do
expect(helper.bookmarked?(SolrDocument.new(id: 'b'))).to eq false
expect(helper.bookmarked?(SolrDocument.new(id: 'b'))).to be false
end
end
end
4 changes: 1 addition & 3 deletions spec/lib/trln_argon/argon_search_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -721,9 +721,7 @@
end

it 'returns nil' do
expect(solr_parameters[:q]).to eq(
nil
)
expect(solr_parameters[:q]).to be_nil
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ class InternetArchiveControllerBehaviorTestClass < InternetArchiveController

describe '#ia_ids_grouped_by_class' do
it 'assembles the response' do
allow(mock_controller).to receive(:ia_api_response).and_return(response.to_json)
allow(mock_controller).to receive(:sanitize_internet_archive_id_params).and_return(ids)
allow(mock_controller).to receive_messages(
ia_api_response: response.to_json,
sanitize_internet_archive_id_params: ids
)
expect(mock_controller.send(:ia_ids_grouped_by_class)).to eq(expectation)
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# rubocop:disable RSpec/FilePath
describe TrlnArgon::SolrDocument::HighwireFieldMapping do
include described_class
# rubocop:disable RSpec/LeakyConstantDeclaration
Expand All @@ -8,6 +7,7 @@ class SolrDocumentTestClass
end
# rubocop:enable RSpec/LeakyConstantDeclaration

# rubocop:disable RSpec/IndexedLet
describe '#highwire_metadata_tags' do
let(:document1) do
SolrDocumentTestClass.new(
Expand Down Expand Up @@ -38,6 +38,7 @@ class SolrDocumentTestClass
'issn_primary_a' => '123456'
)
end
# rubocop:enable RSpec/IndexedLet

it 'generates metadata tags based on the mapping' do
result = document1.highwire_metadata_tags
Expand Down Expand Up @@ -68,4 +69,3 @@ class SolrDocumentTestClass
end
end
end
# rubocop:enable RSpec/FilePath
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)
end
end

# rubocop:disable RSpec/IndexedLet
describe '#render_ris' do
let(:doc_1) { SolrDocument.new(id: 'DUKE001', institution_a: 'duke', owner_a: 'duke') }
let(:doc_2) { SolrDocument.new(id: 'DUKE002', institution_a: 'duke', owner_a: 'duke') }
Expand All @@ -38,5 +38,6 @@
'ER - '\
)
end
# rubocop:enable RSpec/IndexedLet
end
end
8 changes: 5 additions & 3 deletions spec/lib/trln_argon/view_helpers/trln_argon_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,11 @@
end

before do
allow(helper).to receive(:solr_query_params).and_return(solr_params)
allow(helper).to receive(:solr_document_only_path).and_return('/document')
allow(helper).to receive(:solr_query_path).and_return('https://query.discovery.trln.org/trlnbib/')
allow(helper).to receive_messages(
solr_query_params: solr_params,
solr_document_only_path: '/document',
solr_query_path: 'https://query.discovery.trln.org/trlnbib/'
)
end

describe '#solr_document_request' do
Expand Down
9 changes: 6 additions & 3 deletions spec/models/blacklight/suggest_search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@

describe '#suggestions' do
it 'returns a Blacklight::Suggest::Response' do
allow(suggest_search).to receive(:suggest_results).and_return([])
allow(suggest_search).to receive(:suggest_handler_path).and_return(suggest_path)
allow(suggest_search).to receive(:suggest_component).and_return(solr_component)
allow(suggest_search).to receive_messages(
suggest_results: [],
suggest_handler_path: suggest_path,
suggest_component: solr_component
)
expect(suggest_search.suggestions).to be_an Blacklight::Suggest::Response
end
end

describe '#suggest_results' do
it 'calls send_and_recieve from a repository connection' do
allow(suggest_search).to receive(:suggest_handler_path).and_return(suggest_path)
Expand Down

0 comments on commit eb9d42e

Please sign in to comment.