Skip to content

Commit

Permalink
Merge pull request #153 from geeosh/fix-delayed-jobs-at
Browse files Browse the repository at this point in the history
Always convert time .to_i before comparing delayed jobs
  • Loading branch information
packrat386 committed Jun 21, 2020
2 parents 2cd15b0 + dcc6d03 commit e17b5a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rspec/sidekiq/matchers/have_enqueued_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ def matches?(option, value)

def at_evaluator(value)
return false if job['at'].to_s.empty?
value.to_time.to_s == Time.at(job['at']).to_s
value.to_time.to_i == Time.at(job['at']).to_i
end

def in_evaluator(value)
return false if job['at'].to_s.empty?
(Time.now + value).to_s == Time.at(job['at']).to_s
(Time.now + value).to_i == Time.at(job['at']).to_i
end
end

Expand Down

0 comments on commit e17b5a4

Please sign in to comment.