Correct documentation of assert_emails

This commit is contained in:
Rafael Mendonça França 2023-03-31 21:24:01 +00:00
parent 68e107f292
commit 055572ec36
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948

@ -32,20 +32,20 @@ module TestHelper
# end
# end
#
# If a block is passed, the method returns the +Mail::Message+s that were
# processed, enabling further analysis.
# The method returns the +Mail::Message+s that were processed, enabling further
# analysis.
#
# def test_emails_more_thoroughly
# email = assert_emails 1 do
# ContactMailer.welcome.deliver_now
# end
# assert_email "Hi there", email.subject
# assert_equal "Hi there", email.subject
#
# emails = assert_emails 2 do
# ContactMailer.welcome.deliver_now
# ContactMailer.welcome.deliver_later
# end
# assert_email "Hi there", emails.first.subject
# assert_equal "Hi there", emails.first.subject
# end
def assert_emails(number, &block)
if block_given?