1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00

Refactored the with_body matcher using the with_part one

This commit is contained in:
Marcello Barnaba 2011-05-23 23:57:16 +02:00 committed by Jason Morrison
parent d468d3b79d
commit 99428602aa

View file

@ -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