diff --git a/lib/shoulda/matchers/action_mailer/have_sent_email.rb b/lib/shoulda/matchers/action_mailer/have_sent_email.rb index 56fbcf9f..436ab81e 100644 --- a/lib/shoulda/matchers/action_mailer/have_sent_email.rb +++ b/lib/shoulda/matchers/action_mailer/have_sent_email.rb @@ -135,9 +135,7 @@ module Shoulda # :nodoc: # body if the e-mail is multipart. TMail concatenates the # String representation of each part instead. if mail.body.blank? && mail.multipart? - mail.parts.select {|p| p.content_type =~ /^text\//}.all? do |part| - regexp_or_string_match(part.body, a_regexp_or_string) - end + part_match(mail, /^text\//, a_regexp_or_string) else regexp_or_string_match(mail.body, a_regexp_or_string) end