29 lines
793 B
Ruby
29 lines
793 B
Ruby
|
require "test_helper"
|
||
|
|
||
|
class NewsMailerTest < ActionMailer::TestCase
|
||
|
test "letter" do
|
||
|
mail = NewsMailer.letter
|
||
|
assert_equal "Letter", mail.subject
|
||
|
assert_equal ["to@example.org"], mail.to
|
||
|
assert_equal ["from@example.com"], mail.from
|
||
|
assert_match "Hi", mail.body.encoded
|
||
|
end
|
||
|
|
||
|
test "subscribed" do
|
||
|
mail = NewsMailer.subscribed
|
||
|
assert_equal "Subscribed", mail.subject
|
||
|
assert_equal ["to@example.org"], mail.to
|
||
|
assert_equal ["from@example.com"], mail.from
|
||
|
assert_match "Hi", mail.body.encoded
|
||
|
end
|
||
|
|
||
|
test "unsubscribed" do
|
||
|
mail = NewsMailer.unsubscribed
|
||
|
assert_equal "Unsubscribed", mail.subject
|
||
|
assert_equal ["to@example.org"], mail.to
|
||
|
assert_equal ["from@example.com"], mail.from
|
||
|
assert_match "Hi", mail.body.encoded
|
||
|
end
|
||
|
|
||
|
end
|