File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 127127 it "skips wildcard name steps and completes search" do
128128 described_class . perform_now ( patient_changeset )
129129
130- wait_for_jobs_to_finish ( described_class . to_s )
130+ perform_enqueued_jobs_while_exists ( only : described_class )
131131 perform_enqueued_jobs ( only : ProcessPatientChangesetJob )
132132
133133 patient_changeset . reload
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ module ImportsHelper
44 def wait_for_import_to_complete ( import_class )
55 perform_enqueued_jobs ( only : ProcessImportJob )
66
7- wait_for_jobs_to_finish ( " PDSCascadingSearchJob" )
8- wait_for_jobs_to_finish ( " ProcessPatientChangesetJob" )
7+ perform_enqueued_jobs_while_exists ( only : PDSCascadingSearchJob )
8+ perform_enqueued_jobs_while_exists ( only : ProcessPatientChangesetJob )
99
1010 perform_enqueued_jobs ( only : CommitPatientChangesetsJob )
1111 click_on_most_recent_import ( import_class )
@@ -16,10 +16,12 @@ def click_on_most_recent_import(import_class)
1616 match : :first
1717 end
1818
19- def wait_for_jobs_to_finish ( job_class )
19+ def perform_enqueued_jobs_while_exists ( only :)
20+ job_class = only . name
21+
2022 # rubocop:disable Style/WhileUntilModifier
2123 while enqueued_jobs . any? { it [ "job_class" ] == job_class }
22- perform_enqueued_jobs ( only : job_class . constantize )
24+ perform_enqueued_jobs ( only :)
2325 end
2426 # rubocop:enable Style/WhileUntilModifier
2527 end
You can’t perform that action at this time.
0 commit comments