aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
Diffstat (limited to 'guides')
-rw-r--r--guides/source/testing.md7
1 files changed, 4 insertions, 3 deletions
diff --git a/guides/source/testing.md b/guides/source/testing.md
index d6e4aa36db..065ca71d48 100644
--- a/guides/source/testing.md
+++ b/guides/source/testing.md
@@ -1098,9 +1098,10 @@ require 'test_helper'
class UserMailerTest < ActionMailer::TestCase
test "invite" do
# Send the email, then test that it got queued
- email = UserMailer.create_invite('me@example.com',
- 'friend@example.com', Time.now).deliver_now
- assert ActionMailer::Base.deliveries.present?
+ assert_emails 1 do
+ email = UserMailer.create_invite('me@example.com',
+ 'friend@example.com', Time.now).deliver_now
+ end
# Test the body of the sent email contains what we expect it to
assert_equal ['me@example.com'], email.from