Sha256: c7cf4bea58c81b1d8c6ca74f15cbccaf9848c46306894836f9e986aa39b73947
Contents?: true
Size: 927 Bytes
Versions: 1
Compression:
Stored size: 927 Bytes
Contents
require_relative './../test_helper' class WorkerTest < ActiveSupport::TestCase def setup Delayed::Worker.delay_jobs = true end def teardown Delayed::Worker.destroy_completed_jobs = false end def test_run_job thing = Thing.create(:name => 'test') job = Delayed::Job.enqueue(TestJob.new(thing.id)) worker = Delayed::Worker.new worker.run(job) job.reload assert job.completed_at.present? assert_equal 1000, job.progress_current assert_equal 'complete', job.message assert_nil job.locked_by assert_nil job.locked_at end def test_run_job_and_destroy Delayed::Worker.destroy_completed_jobs = true thing = Thing.create(:name => 'test') thing.delay.something job = Delayed::Job.last assert_difference 'Delayed::Job.count', -1 do worker = Delayed::Worker.new worker.run(job) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
delayed_job_progress-0.0.3 | test/extensions/worker_test.rb |