Rails/Rspec: Testing delayed_job mails

前端 未结 5 822
你的背包
你的背包 2021-02-01 17:37

Just wondering how to test that actionmailer requests are actually sent to the delayed_job que in rspec.

I would have assumed it was quite simple, but my delayed_job que

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-01 17:59

    You can also follow the convention (from Railscast 275) of

        ActionMailer::Base.deliveries.last.to.should == user.email
    

    but instead do this:

        Delayed::Job.last.handler.should have_content(user.email)
    

提交回复
热议问题