【发布时间】:2016-05-27 00:12:46
【问题描述】:
我目前在使用 Sidekiq 伪造模式测试 sidekiq worker 时遇到问题。
我把worker作为一个对象运行,worker会自己创建,满足一定条件的就是同一个worker。
问题是worker被推入jobs数组,这将jobs数组的大小增加了1,这是完美的!但它也继续运行工人!
worker = AvailablePromoJobBulkNotificationWorker.new
it "will create the next worker after the current worker performed." do
expect { worker.perform(promo.id) }.to change(AvailablePromoJobBulkNotificationWorker.jobs, :size).by(1)
end
【问题讨论】:
标签: ruby-on-rails ruby rspec sidekiq