form mailer
This commit is contained in:
12
test/mailers/form_mailer_test.rb
Normal file
12
test/mailers/form_mailer_test.rb
Normal file
@ -0,0 +1,12 @@
|
||||
require "test_helper"
|
||||
|
||||
class FormMailerTest < ActionMailer::TestCase
|
||||
test "received" do
|
||||
mail = FormMailer.received
|
||||
assert_equal "Received", mail.subject
|
||||
assert_equal ["to@example.org"], mail.to
|
||||
assert_equal ["from@example.com"], mail.from
|
||||
assert_match "Hi", mail.body.encoded
|
||||
end
|
||||
|
||||
end
|
9
test/mailers/previews/form_mailer_preview.rb
Normal file
9
test/mailers/previews/form_mailer_preview.rb
Normal file
@ -0,0 +1,9 @@
|
||||
# Preview all emails at http://localhost:3000/rails/mailers/form_mailer
|
||||
class FormMailerPreview < ActionMailer::Preview
|
||||
|
||||
# Preview this email at http://localhost:3000/rails/mailers/form_mailer/received
|
||||
def received
|
||||
FormMailer.received
|
||||
end
|
||||
|
||||
end
|
Reference in New Issue
Block a user