Skip to content

Commit

Permalink
🐛 Fix solr endpoint default issue (#2179)
Browse files Browse the repository at this point in the history
* Fix solr endpoint default issue

#2177

* Fix spec
  • Loading branch information
laritakr authored Apr 5, 2024
1 parent e720484 commit 54fccb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/hyrax/solr_service_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ def reset!

Hyrax.index_adapter&.reset!
end

# Override Hyrax SolrService connection method to always use Hyku's connection method.
def connection
SolrEndpoint.new.connection
end
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/requests/catalog_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
WebMock.disable!
allow(AccountElevator).to receive(:switch!).with(cross_search_tenant_account.cname).and_return('public')
allow(Apartment::Tenant.adapter).to receive(:connect_to_new).and_return('')
allow_any_instance_of(Hyrax::SolrService).to receive(:connection).and_return(sample_solr_connection)
allow_any_instance_of(Hyrax::SolrServiceDecorator).to receive(:connection).and_return(sample_solr_connection)

Hyrax::SolrService.add(hyku_sample_work.to_solr)
Hyrax::SolrService.commit
Expand Down

0 comments on commit 54fccb0

Please sign in to comment.