test.rb 中的 action_mailer.delivery_method 未遵循

发布于 2024-12-12 05:40:06 字数 309 浏览 0 评论 0原文

我注意到我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤独陪着我 2024-12-19 05:40:06

您可能

ActionMailer::Base.delivery_method = :smtp

在 test.rb 运行后在某处设置了 Being。

您应该在 Production.rb 中配置生产邮件程序详细信息

You probably have

ActionMailer::Base.delivery_method = :smtp

Being set somewhere after the test.rb is run.

You should configure your production mailer details inside production.rb

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文