1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00

deprecate #assert_sent_email and assert_did_not_send_email

This commit is contained in:
Mike Burns 2010-06-08 12:17:56 -04:00
parent 7a468f9b1b
commit 207ace93f8

View file

@ -1,4 +1,3 @@
### TODO: replace with matches
module Shoulda # :nodoc:
module ActionMailer # :nodoc:
module Assertions
@ -32,6 +31,7 @@ module Shoulda # :nodoc:
#
# assert_did_not_send_email
def assert_did_not_send_email
::ActiveSupport::Deprecation.warn("use: should_not have_sent_email")
msg = "Sent #{::ActionMailer::Base.deliveries.size} emails.\n"
::ActionMailer::Base.deliveries.each { |m| msg << " '#{m.subject}' sent to #{m.to.to_sentence}\n" }
assert ::ActionMailer::Base.deliveries.empty?, msg