test.rb 中的 action_mailer.delivery_method 未遵循
我注意到我的 Cucumber 测试开始需要很长时间才能运行,最终我意识到这是因为当我使用邮件程序时它试图连接到 smtp 服务器。我的 test.rb 文件中已经有以下行:
config.action_mailer.delivery_method = :test
但是,似乎没有遵循该设置。如果我从 mailer.rb 文件中删除下面的行,那么一切都会正常工作:
ActionMailer::Base.delivery_method = :smtp
当然,如果我删除该行,那么生产版本将不再工作......
任何想法?
I've noticed my Cucumber tests started to take a loooong time to run, and eventually I realized it's because it's trying to connect to an smtp server when I use mailers. I already have the following line on my test.rb file:
config.action_mailer.delivery_method = :test
However, that setting doesn't seem to be followed. If I remove the line below from my mailer.rb file, then it all works fine:
ActionMailer::Base.delivery_method = :smtp
Of course if I remove that line, then the production version won't work anymore...
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能
在 test.rb 运行后在某处设置了 Being。
您应该在 Production.rb 中配置生产邮件程序详细信息
You probably have
Being set somewhere after the test.rb is run.
You should configure your production mailer details inside production.rb