instance method
assert_no_part
Ruby on Rails edge
Since edgeSignature
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_typereq -
mailopt = 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