instance method assert_no_part

Ruby on Rails edge

Since edge

Signature

assert_no_part(content_type, mail = last_delivered_mail!)

Assert that a Mail instance does not have a part with a matching MIME type

By default, assert against the last delivered Mail.

UsersMailer.create(user).deliver_now

assert_no_part :html
assert_no_part :text

Parameters

content_type req
mail opt = last_delivered_mail!
Source
# File actionmailer/lib/action_mailer/test_case.rb, line 129
      def assert_no_part(content_type, mail = last_delivered_mail!)
        mime_type = Mime[content_type]
        part = [*mail.all_parts, mail].find { |part| mime_type.match?(part.mime_type) }

        assert_nil part, "expected no part matching #{mime_type} in #{mail.inspect}"
      end

Defined in actionmailer/lib/action_mailer/test_case.rb line 129 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionMailer::TestCase::Behavior

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close