Skip to content

Commit

Permalink
Merge pull request #2105 from samvera/hyrax-5-upgrade-allow-clean_repo
Browse files Browse the repository at this point in the history
🧹 Allow :clean or :clean_repo to work for the cleaners
  • Loading branch information
jeremyf authored Dec 21, 2023
2 parents 046c6ea + 75fc391 commit 9eed101
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,14 @@
# make sure we are on the default fedora config
ActiveFedora::Fedora.reset!
ActiveFedora::SolrService.reset!
# Pass `:clean' to destroy objects in fedora/solr and start from scratch
ActiveFedora::Cleaner.clean! if example.metadata[:clean]
# Pass `:clean' (or hyrax's convention of :clean_repo) to destroy objects in fedora/solr and
# start from scratch
if example.metadata[:clean] || example.metadata[:clean_repo]
## We don't need to do `Hyrax::SolrService.wipe!` so long as we're using `ActiveFedora.clean!`;
## but Valkyrie is coming so be prepared.
# Hyrax::SolrService.wipe!
ActiveFedora::Cleaner.clean!
end
if example.metadata[:type] == :feature && Capybara.current_driver != :rack_test
DatabaseCleaner.strategy = :truncation
else
Expand Down

0 comments on commit 9eed101

Please sign in to comment.