1
我试图在Rspec中剔除一个ActiveJob方法,但我真的不能摆弄它。我正在为Mailchimp发送电子邮件,这是MailingListUnsubscribeJob
。电话是:存根设置稍后perform_later ActiveJob
MailingListUnsubscribeJob.set(wait: 20.days).perform_later(subject: user, list: "activation")
通常我在做Rspec的没有当set(wait: 20.days)
但我只是perform_later
我做了以下在我的规格:
allow(MailingListUnsubscribeJob).to receive(:perform_later)
,但它不工作。 有什么想法?