From dcc6d037a2333a5af73ead81809b484fd0e9ac13 Mon Sep 17 00:00:00 2001 From: Josh Schwartzman Date: Wed, 25 Apr 2018 22:10:35 -0700 Subject: [PATCH] Always convert time .to_i before comparing --- lib/rspec/sidekiq/matchers/have_enqueued_job.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rspec/sidekiq/matchers/have_enqueued_job.rb b/lib/rspec/sidekiq/matchers/have_enqueued_job.rb index 47de859..dd96ee9 100644 --- a/lib/rspec/sidekiq/matchers/have_enqueued_job.rb +++ b/lib/rspec/sidekiq/matchers/have_enqueued_job.rb @@ -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