Skip to content

Commit

Permalink
Test parameters to GoodJob.cleanup_preserved_jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
aried3r committed Aug 30, 2021
1 parent b0ad215 commit 38fb393
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/lib/good_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,15 @@
expect { old_unfinished_job.reload }.not_to raise_error
expect { old_finished_job.reload }.to raise_error ActiveRecord::RecordNotFound
end

it 'takes arguments' do
deleted_jobs_count = described_class.cleanup_preserved_jobs(before_seconds_ago: 10)

expect(deleted_jobs_count).to eq 2

expect { recent_job.reload }.to raise_error
expect { old_unfinished_job.reload }.not_to raise_error
expect { old_finished_job.reload }.to raise_error ActiveRecord::RecordNotFound
end
end
end

0 comments on commit 38fb393

Please sign in to comment.