3
4
5
6
7
8
9
10
11
12
13
|
# File 'lib/rspec/dunlop/matchers/be_retried_by_delayed_job.rb', line 3
def matches?(expected)
@failure_message = "This expectation only works with Delayed::Worker.delay_jobs = true" and return false unless Delayed::Worker.delay_jobs
begin
expected.reload
rescue => e
@failure_message = "The job no longer exists in the database" and return false
end
@failure_message = "The job has a failed_at date so will not be retried" and return false unless expected.failed_at.blank?
true
end
|