I was wondering how I can stub all mailers in my rspec tests? I noticed that I am currently delivering emails when running my tests.
Thank you
Edit:
I'm using sidekiq to delay deliver emails, as well as gem 'devise-async' to deliver emails in the background.
config.action_mailer.delivery_method = :test still delivers emails.
您可以使用...
YourMailer.stub_chain(:delay, :send_method)
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.