aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2013-01-26 08:14:26 -0800
committerJosé Valim <jose.valim@plataformatec.com.br>2013-01-26 08:14:26 -0800
commit474e7dd82af030fb22ab5a586976d21b3497882a (patch)
tree2e98ae0c079dba5012b08c4b1ce84e81c1180ab2 /guides
parent647d18c92c77b96754c7e9e3d9142f18e0772061 (diff)
parent18dceeb425a92254f534202ec6ced700cfdd1567 (diff)
downloadrails-474e7dd82af030fb22ab5a586976d21b3497882a.tar.gz
rails-474e7dd82af030fb22ab5a586976d21b3497882a.tar.bz2
rails-474e7dd82af030fb22ab5a586976d21b3497882a.zip
Merge pull request #9084 from senny/document_am_delivieries_reset
document the behavior of `ActionMailer::Base.delivieries` in tests
Diffstat (limited to 'guides')
-rw-r--r--guides/source/action_mailer_basics.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/guides/source/action_mailer_basics.md b/guides/source/action_mailer_basics.md
index 3a9a4e73a6..513ae1272f 100644
--- a/guides/source/action_mailer_basics.md
+++ b/guides/source/action_mailer_basics.md
@@ -576,6 +576,8 @@ end
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.
+NOTE: The `ActionMailer::Base.deliveries` array is only reset automatically in `ActionMailer::TestCase` tests. If you want to have a clean slate outside Action Mailer tests, you can reset it manually with: `ActionMailer::Base.deliveries.clear`
+
Intercepting Emails
-------------------
There are situations where you need to edit an email before it's delivered. Fortunately Action Mailer provides hooks to intercept every email. You can register an interceptor to make modifications to mail messages right before they are handed to the delivery agents.