Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

It's better to pass strings to assert_match - it converts them to reg…

…ular expressions, escaping special chars like '.'. It seems email.encoded contains some unexpected line breaks (due to encoding), it's better to assert_match email.body.to_s.
  • Loading branch information...
commit ad1c447a99bcad751a10226262666d7c978279ee 1 parent 8139daa
@qoobaa qoobaa authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 guides/source/action_mailer_basics.textile
4 guides/source/action_mailer_basics.textile
@@ -508,8 +508,8 @@ class UserMailerTest < ActionMailer::TestCase
# Test the body of the sent email contains what we expect it to
assert_equal [],
assert_equal "Welcome to My Awesome Site", email.subject
- assert_match(/<h1>Welcome to, #{}<\/h1>/, email.encoded)
- assert_match(/Welcome to, #{}/, email.encoded)
+ assert_match "<h1>Welcome to, #{}</h1>", email.body.to_s
+ assert_match "Welcome to, #{}", email.body.to_s
Please sign in to comment.
Something went wrong with that request. Please try again.