Skip to content

Commit

Permalink
make default_workflow_spec.rb order independent
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tamsin woo committed Mar 26, 2024
1 parent 56c25f0 commit c1cf59f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spec/features/default_workflow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c1cf59f

Please # to comment.