File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
spec/rspec/rails/matchers Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,12 @@ def on_queue(queue)
3030 self
3131 end
3232
33- def at ( date )
34- @at = date
33+ def at ( time_or_date )
34+ case time_or_date
35+ when Time then @at = Time . at ( time_or_date . to_f )
36+ else
37+ @at = time_or_date
38+ end
3539 self
3640 end
3741
Original file line number Diff line number Diff line change @@ -216,6 +216,13 @@ def self.name; "LoggingJob"; end
216216 } . to have_enqueued_job . at ( date )
217217 end
218218
219+ it "passes with provided at time" do
220+ time = Time . now + 1 . day
221+ expect {
222+ hello_job . set ( wait_until : time ) . perform_later
223+ } . to have_enqueued_job . at ( time )
224+ end
225+
219226 it "accepts composable matchers as an at date" do
220227 future = 1 . minute . from_now
221228 slightly_earlier = 58 . seconds . from_now
You can’t perform that action at this time.
0 commit comments