我想在本地测试我的注册过程(开发模式),我如何测试电子邮件将如何发送和呈现等?
我不是指单元测试或集成测试,而是在开发我的应用程序并进入注册页面等时。我希望它发送电子邮件但不使用 smtp 的文件。
这可能吗?
我有哪些选择?
最佳答案
这可以在 config/environments/*.rb
中配置文件。
# output to tmp/mails directory
config.action_mailer.delivery_method = :file
# ... and to specify output location
# config.action_mailer.file_settings = { :location => Rails.root.join('tmp/mail') }
详细信息可以在config section中找到。的 Action Mailer Basics或在 ActionMailer::Base API
rails 4.2
:file
delivery method source和 Mail::FileDelivery source
关于ruby-on-rails - ActionMailer和开发模式,能不能写文件什么的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5286009/