test/plugins/restart_test.rb in rocketjob-3.0.0.rc2 vs test/plugins/restart_test.rb in rocketjob-3.0.0.rc3

- old
+ new

@@ -60,11 +60,11 @@ it 'does not queue a new job when expired' do @job = RestartableJob.create!(expires_at: Time.now - 1.day) assert @job.expired? @job.abort! assert_equal 1, RestartableJob.count - assert_equal nil, RestartableJob.where(:id.ne => @job.id).first + assert_nil RestartableJob.where(:id.ne => @job.id).first end end describe '#complete' do it 'queues a new job when destroy_on_complete' do @@ -130,11 +130,11 @@ @job = RestartableJob.new(expires_at: Time.now - 1.day) @job.start! assert @job.running? assert @job.expired? assert_equal 1, RestartableJob.count - assert_equal nil, RestartableJob.where(:id.ne => @job.id).first + assert_nil RestartableJob.where(:id.ne => @job.id).first end end describe '#create_new_instance' do it 'sets job back to queued state' do @@ -158,20 +158,20 @@ refute_equal 'start_at', key, "Should not include start_at in retried job. #{job2.attributes.inspect}" next if RestartableJob.rocket_job_restart_excludes.include?(key) assert_equal value, job2[key], "Attributes are supposed to be copied across. For #{key}" end - assert_equal nil, job2.start_at - assert_equal nil, job2.end_at + assert_nil job2.start_at + assert_nil job2.end_at assert_equal :queued, job2.state assert job2.created_at - assert_equal nil, job2.started_at - assert_equal nil, job2.completed_at + assert_nil job2.started_at + assert_nil job2.completed_at assert_equal 0, job2.failure_count - assert_equal nil, job2.worker_name + assert_nil job2.worker_name assert_equal 0, job2.percent_complete - assert_equal nil, job2.exception + assert_nil job2.exception refute job2.result end it 'copies run_at when it is in the future' do @job = RestartableJob.create!(run_at: Time.now + 1.day, destroy_on_complete: true) @@ -184,10 +184,10 @@ it 'does not copy run_at when it is in the past' do @job = RestartableJob.create!(run_at: Time.now - 1.day, destroy_on_complete: true) @job.perform_now assert_equal 1, RestartableJob.count assert job2 = RestartableJob.where(:id.ne => @job.id).first - assert_equal nil, job2.run_at + assert_nil job2.run_at end end end end