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:
parent
d468d3b79d
commit
99428602aa
1 changed files with 1 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue