diff --git a/spec/models/hyrax/permission_template_spec.rb b/spec/models/hyrax/permission_template_spec.rb index b46ddcef10..84b1931be0 100644 --- a/spec/models/hyrax/permission_template_spec.rb +++ b/spec/models/hyrax/permission_template_spec.rb @@ -53,7 +53,7 @@ end end - describe "#source_model" do + describe "#source_model", valkyrie_adapter: :wings_adapter do context 'when source is an AdminSet' do let(:admin_set) { FactoryBot.create(:admin_set) } let(:attributes) { { source_id: admin_set.id } } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 47e090b571..337e2293f0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -214,7 +214,10 @@ def clean_active_fedora_repository config.before(:each, type: :feature) do |example| clean_active_fedora_repository unless - example.metadata[:clean_repo] # trust clean_repo if present + # trust that clean_repo performed the clean if present + example.metadata[:clean_repo] || + # don't run for adapters other than wings + (example.metadata[:valkyrie_adapter].present? && example.metadata[:valkyrie_adapter] != :wings_adapter) end config.after(:each, type: :feature) do @@ -249,9 +252,9 @@ def clean_active_fedora_repository config.profile_examples = 10 config.before(:example, :clean_repo) do - clean_active_fedora_repository - Hyrax::RedisEventStore.instance.redis.flushdb + clean_active_fedora_repository unless Hyrax.config.disable_wings + Hyrax::RedisEventStore.instance.redis.flushdb # Not needed to clean the Solr core used by ActiveFedora since # clean_active_fedora_repository will wipe that core Hyrax::SolrService.wipe! if Hyrax.config.query_index_from_valkyrie @@ -317,6 +320,11 @@ def clean_active_fedora_repository allow(Hyrax) .to receive(:metadata_adapter) .and_return(Valkyrie::MetadataAdapter.find(adapter_name)) + + if adapter_name != :wings_adapter + allow(Hyrax.config).to receive(:disable_wings).and_return(true) + hide_const("Wings") # disable_wings=true removes the Wings constant + end end # turn on the default nested reindexer; we use a null implementation for most