Methods
Public Instance methods
[ show source ]
# File test/mail_helper_test.rb, line 56
56: def new_mail( charset="utf-8" )
57: mail = TMail::Mail.new
58: mail.set_content_type "text", "plain", { "charset" => charset } if charset
59: mail
60: end
[ show source ]
# File test/mail_helper_test.rb, line 62
62: def setup
63: ActionMailer::Base.delivery_method = :test
64: ActionMailer::Base.perform_deliveries = true
65: ActionMailer::Base.deliveries = []
66:
67: @recipient = 'test@localhost'
68: end
[ show source ]
# File test/mail_helper_test.rb, line 70
70: def test_use_helper
71: mail = HelperMailer.create_use_helper(@recipient)
72: assert_match %r{Mr. Joe Person}, mail.encoded
73: end
[ show source ]
# File test/mail_helper_test.rb, line 80
80: def test_use_helper_method
81: mail = HelperMailer.create_use_helper_method(@recipient)
82: assert_match %r{HelperMailer}, mail.encoded
83: end
[ show source ]
# File test/mail_helper_test.rb, line 85
85: def test_use_mail_helper
86: mail = HelperMailer.create_use_mail_helper(@recipient)
87: assert_match %r{ But soft!}, mail.encoded
88: assert_match %r{east, and\n Juliet}, mail.encoded
89: end
[ show source ]
# File test/mail_helper_test.rb, line 75
75: def test_use_test_helper
76: mail = HelperMailer.create_use_test_helper(@recipient)
77: assert_match %r{<em><strong><small>emphasize me!}, mail.encoded
78: end