start on news mailer
This commit is contained in:
28
test/mailers/news_mailer_test.rb
Normal file
28
test/mailers/news_mailer_test.rb
Normal file
@ -0,0 +1,28 @@
|
||||
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
|
@ -3,7 +3,7 @@ class FormMailerPreview < ActionMailer::Preview
|
||||
|
||||
# Preview this email at http://localhost:3000/rails/mailers/form_mailer/received
|
||||
def received
|
||||
FormMailer.received
|
||||
FormMailer.received name: "Me" , email: "You"
|
||||
end
|
||||
|
||||
end
|
||||
|
7
test/mailers/previews/news_mailer_preview.rb
Normal file
7
test/mailers/previews/news_mailer_preview.rb
Normal file
@ -0,0 +1,7 @@
|
||||
class NewsMailerPreview < ActionMailer::Preview
|
||||
|
||||
def letter
|
||||
NewsMailer.letter
|
||||
end
|
||||
|
||||
end
|
Reference in New Issue
Block a user