diff options
Diffstat (limited to 'railties/guides/source/action_mailer_basics.textile')
-rw-r--r-- | railties/guides/source/action_mailer_basics.textile | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/railties/guides/source/action_mailer_basics.textile b/railties/guides/source/action_mailer_basics.textile index 142b9dba7e..ad5b848d2c 100644 --- a/railties/guides/source/action_mailer_basics.textile +++ b/railties/guides/source/action_mailer_basics.textile @@ -467,7 +467,7 @@ The following configuration options are best made in one of the environment file h4. Example Action Mailer Configuration -An example would be adding the following to your appropriate <tt>config/environments/env.rb</tt> file: +An example would be adding the following to your appropriate <tt>config/environments/$RAILS_ENV.rb</tt> file: <ruby> config.action_mailer.delivery_method = :sendmail @@ -482,7 +482,7 @@ config.action_mailer.raise_delivery_errors = true h4. Action Mailer Configuration for GMail -As Action Mailer now uses the Mail gem, this becomes as simple as adding to your <tt>config/environments/env.rb</tt> file: +As Action Mailer now uses the Mail gem, this becomes as simple as adding to your <tt>config/environments/$RAILS_ENV.rb</tt> file: <ruby> config.action_mailer.delivery_method = :smtp @@ -514,14 +514,10 @@ class UserMailerTest < ActionMailer::TestCase # Test the body of the sent email contains what we expect it to assert_equal [user.email], email.to assert_equal "Welcome to My Awesome Site", email.subject - assert_match /<h1>Welcome to example.com, #{user.name}<\/h1>/, email.encoded - assert_match /Welcome to example.com, #{user.name}/, email.encoded + assert_match(/<h1>Welcome to example.com, #{user.name}<\/h1>/, email.encoded) + assert_match(/Welcome to example.com, #{user.name}/, email.encoded) end end </ruby> In the test we send the email and store the returned object in the +email+ variable. We then ensure that it was sent (the first assert), then, in the second batch of assertions, we ensure that the email does indeed contain what we expect. - -h3. Changelog - -* September 30, 2010: Fixed typos and reformatted Action Mailer configuration table for better understanding. "Jaime Iniesta":http://jaimeiniesta.com |