简体   繁体   中英

Rails rspec stub mailers sidekiq

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.

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