aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/mail_service_test.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-04-22 15:26:03 +0100
committerPratik Naik <pratiknaik@gmail.com>2009-04-22 15:26:03 +0100
commit5f3f100ce2d689480da85abc88e5e940cf90189e (patch)
tree15c1a05a5308a9eea56d7f0889ac46d9cac5b57c /actionmailer/test/mail_service_test.rb
parentd758d996d1b66e2a65640f79f01ce2ac674d7ed5 (diff)
parentca49299434bc764b667cd86846d892e91a150ef3 (diff)
downloadrails-5f3f100ce2d689480da85abc88e5e940cf90189e.tar.gz
rails-5f3f100ce2d689480da85abc88e5e940cf90189e.tar.bz2
rails-5f3f100ce2d689480da85abc88e5e940cf90189e.zip
Merge branch 'master' into active_model
Conflicts: activeresource/lib/active_resource/validations.rb
Diffstat (limited to 'actionmailer/test/mail_service_test.rb')
-rw-r--r--actionmailer/test/mail_service_test.rb26
1 files changed, 22 insertions, 4 deletions
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb
index 277a91395d..b7d5fd5dd3 100644
--- a/actionmailer/test/mail_service_test.rb
+++ b/actionmailer/test/mail_service_test.rb
@@ -565,13 +565,31 @@ class ActionMailerTest < Test::Unit::TestCase
TestMailer.deliver_signed_up(@recipient)
end
+ class FakeLogger
+ attr_reader :info_contents, :debug_contents
+
+ def initialize
+ @info_contents, @debug_contents = "", ""
+ end
+
+ def info(str)
+ @info_contents << str
+ end
+
+ def debug(str)
+ @debug_contents << str
+ end
+ end
+
def test_delivery_logs_sent_mail
mail = TestMailer.create_signed_up(@recipient)
- logger = mock()
- logger.expects(:info).with("Sent mail to #{@recipient}")
- logger.expects(:debug).with("\n#{mail.encoded}")
- TestMailer.logger = logger
+ # logger = mock()
+ # logger.expects(:info).with("Sent mail to #{@recipient}")
+ # logger.expects(:debug).with("\n#{mail.encoded}")
+ TestMailer.logger = FakeLogger.new
TestMailer.deliver_signed_up(@recipient)
+ assert(TestMailer.logger.info_contents =~ /Sent mail to #{@recipient}/)
+ assert_equal(TestMailer.logger.debug_contents, "\n#{mail.encoded}")
end
def test_unquote_quoted_printable_subject