应用集成测试与用户管理系统搭建
1. 电子邮件功能测试
在开发过程中,我们对生成的电子邮件部分内容进行了定制。为了确保其正确性,需要更新测试用例。以下是电子邮件功能测试的代码:
require 'test_helper'
class NotifierTest < ActionMailer::TestCase
test "order_received" do
mail = Notifier.order_received(orders(:one))
assert_equal "Pragmatic Store Order Confirmation", mail.subject
assert_equal ["dave@example.org"], mail.to
assert_equal ["depot@example.com"], mail.from
assert_match /1 x Programming Ruby 1.9/, mail.body.encoded
end
test "order_shipped" do
mail = Notifier.order_shipped(orders(:one))
assert_equal "Pragmatic Store Order Shipped", mail.subject
assert_equal ["dave@example.org"], mail.to
assert_equal ["depot@example.com"], mail.from
assert_match /<td>1&a
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



