From 8d17af23ef5202e7c28bbf701e247bce6011df07 Mon Sep 17 00:00:00 2001
From: Sunny Ripert <sunny@sunfox.org>
Date: Thu, 17 Nov 2011 17:05:53 +0100
Subject: Guides: better example to find the last sent email

---
 railties/guides/source/testing.textile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'railties/guides/source/testing.textile')

diff --git a/railties/guides/source/testing.textile b/railties/guides/source/testing.textile
index 2341a3522c..5dbbe2c0f0 100644
--- a/railties/guides/source/testing.textile
+++ b/railties/guides/source/testing.textile
@@ -927,7 +927,7 @@ class UserControllerTest < ActionController::TestCase
     assert_difference 'ActionMailer::Base.deliveries.size', +1 do
       post :invite_friend, :email => 'friend@example.com'
     end
-    invite_email = ActionMailer::Base.deliveries.first
+    invite_email = ActionMailer::Base.deliveries.last
 
     assert_equal "You have been invited by me@example.com", invite_email.subject
     assert_equal 'friend@example.com', invite_email.to[0]
-- 
cgit v1.2.3

