method

assert_no_enqueued_emails

Importance_1
v5.1.7 - Show latest stable - 0 notes - Class: ActionMailer::TestHelper
assert_no_enqueued_emails(&block) public

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
Show source
Register or log in to add new notes.