Method: ActionMailer::TestHelper#assert_no_enqueued_emails

Defined in:
actionmailer/lib/action_mailer/test_helper.rb

#assert_no_enqueued_emails(&block) ⇒ Object

Asserts that no emails are enqueued for later delivery.

def test_no_emails
  assert_no_enqueued_emails
  ContactMailer.welcome.deliver_later
  assert_enqueued_emails 1
end

If a block is provided, it should not cause any emails to be enqueued.

def test_no_emails
  assert_no_enqueued_emails do
    # No emails should be enqueued from this block
  end
end


207
208
209
# File 'actionmailer/lib/action_mailer/test_helper.rb', line 207

def assert_no_enqueued_emails(&block)
  assert_enqueued_emails 0, &block
end