简体   繁体   中英

Sidekiq + Rails: Delayed Extension Default Worker

I'm using Sidekiq in my Rails app to asynchronously perform some tasks. I've created workers for some of my more complex operations, but there are a lot of simple cases where I call Class.delay.some_method . I'd like to write tests to make sure these jobs are getting enqueued correctly.

When I create a worker to perform these jobs, I can check the queueing by making assertions about SomeWorker.jobs in my specs. Is there a way to do something similar when I call #delay on a class directly? If it makes any difference, the class inherits from ActiveRecord::Base.

assert_equal 1, Sidekiq::Extensions::DelayedClass.jobs.size

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM