aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/generators/test_unit/mailer/templates/functional_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/generators/test_unit/mailer/templates/functional_test.rb')
-rw-r--r--railties/lib/generators/test_unit/mailer/templates/functional_test.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/railties/lib/generators/test_unit/mailer/templates/functional_test.rb b/railties/lib/generators/test_unit/mailer/templates/functional_test.rb
index a2b1f1ed05..0d7c517557 100644
--- a/railties/lib/generators/test_unit/mailer/templates/functional_test.rb
+++ b/railties/lib/generators/test_unit/mailer/templates/functional_test.rb
@@ -3,12 +3,11 @@ require 'test_helper'
class <%= class_name %>Test < ActionMailer::TestCase
<% for action in actions -%>
test "<%= action %>" do
- @expected.subject = <%= action.to_s.humanize.inspect %>
- @expected.to = "to@example.org"
- @expected.from = "from@example.com"
- @expected.body = read_fixture("<%= action %>")
-
- assert_equal @expected, <%= class_name %>.<%= action %>
+ mail = <%= class_name %>.<%= action %>
+ assert_equal <%= action.to_s.humanize.inspect %>, mail.subject
+ assert_equal ["to@example.org"], mail.to
+ assert_equal ["from@example.com"], mail.from
+ assert_match "Hi, find me in app", mail.body.encoded
end
<% end -%>