From c1cf59f1640a00a7a89e2c59db726108d2e2c7d2 Mon Sep 17 00:00:00 2001 From: tamsin woo Date: Tue, 26 Mar 2024 15:30:04 -0700 Subject: [PATCH] make `default_workflow_spec.rb` order independent this is a bit of a cudgel, i guess, but something somewhere is sometimes removing workflows, and this spec fails intermittently because of it. it can just ensure the workflow exists before running. --- spec/features/default_workflow_spec.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/features/default_workflow_spec.rb b/spec/features/default_workflow_spec.rb index 90995bd24a..7d3a1463d2 100644 --- a/spec/features/default_workflow_spec.rb +++ b/spec/features/default_workflow_spec.rb @@ -12,7 +12,14 @@ let(:attributes) { :LEGACY_UNUSED_ARGUMENT_WITH_NO_KNOWN_USE_CASE_SHOULD_NEVER_BE_REQUIRED } let(:workflow_factory) { Hyrax::Workflow::WorkflowFactory } - before { Hyrax::EnsureWellFormedAdminSetService.call } + before do + admin_set_id = Hyrax::EnsureWellFormedAdminSetService.call + begin + Sipity::Workflow.find_active_workflow_for(admin_set_id: admin_set_id) + rescue NoActiveWorkflowError => _ + Hyrax::Workflow::WorkflowImporter.load_workflows + end + end it 'sets state to "deposited"' do workflow_factory.create(work, attributes, depositor)