test/activejob_adapter_test.rb in dynflow-1.2.1 vs test/activejob_adapter_test.rb in dynflow-1.2.2

- old
+ new

@@ -6,14 +6,17 @@ class SampleJob < ::ActiveJob::Base queue_as :slow def perform(msg) puts "This job says #{msg}" + puts "provider_job_id is #{provider_job_id}" end end describe 'running jobs' do + include TestHelpers + let :world do WorldFactory.create_world end before(:all) do @@ -46,12 +49,16 @@ it 'enqueues the job' do job = nil out, = capture_subprocess_io do job = SampleJob.perform_later 'hello' + wait_for do + plan = world.persistence.load_execution_plan(job.provider_job_id) + plan.state == :stopped + end end - assert world.persistence.load_execution_plan(job.provider_job_id) assert_match(/Enqueued Dynflow::SampleJob/, out) + assert_match(/provider_job_id is #{job.provider_job_id}/, out) end it 'schedules job in the future' do job = nil out, = capture_subprocess_io do