gpt4 book ai didi

rspec - rspec-email-如何获取正文?

转载 作者:行者123 更新时间:2023-12-03 15:05:58 29 4
gpt4 key购买 nike

我将rspec与电子邮件规范gem一起使用。我正在尝试做:

last_delivery = ActionMailer::Base.deliveries.last
last_delivery.body.should include "This is the text of the email"


但这是行不通的,有没有办法说出正文,文本版本?内容类型:文本/文本?

谢谢

最佳答案

主体实际上是一个Mail::Body实例。调用raw_source应该可以解决问题:

last_delivery = ActionMailer::Base.deliveries.last
last_delivery.body.raw_source.should include "This is the text of the email"

关于rspec - rspec-email-如何获取正文?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5384473/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com