From 75fc391833e9caf86c16a7fd0ed7651010dbe914 Mon Sep 17 00:00:00 2001 From: Jeremy Friesen Date: Thu, 21 Dec 2023 11:47:32 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Allow=20:clean=20or=20:clean=5Fr?= =?UTF-8?q?epo=20to=20work=20for=20the=20cleaners?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hyrax has :clean_repo and Hyku has :clean Sometimes folks copy over specs from Hyrax, and bring along the :clean_repo; which looks like it should work. With this commit, we bring that logic along! --- spec/rails_helper.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index b531672ab..70800107a 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -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