diff options
author | Andrew Kaspick <andrew@redlinesoftware.com> | 2011-08-11 17:49:31 -0500 |
---|---|---|
committer | Andrew Kaspick <andrew@redlinesoftware.com> | 2011-08-11 17:49:31 -0500 |
commit | 60d358b23348a14447d176fa51624ad5434eb575 (patch) | |
tree | d82803881241e15fdbdea6915f0fde5b7e1d284a /actionpack/lib/action_dispatch/testing/assertions | |
parent | e6fdfd0f6f80d47c97152826322ea8b01519b5c2 (diff) | |
download | rails-60d358b23348a14447d176fa51624ad5434eb575.tar.gz rails-60d358b23348a14447d176fa51624ad5434eb575.tar.bz2 rails-60d358b23348a14447d176fa51624ad5434eb575.zip |
fix assert_select_email to work on non-multipart emails as well as converting the Mail::Body to a string to prevent errors.
Diffstat (limited to 'actionpack/lib/action_dispatch/testing/assertions')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/selector.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb index 5fa91d1a76..b4555f4f59 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb @@ -415,9 +415,9 @@ module ActionDispatch assert !deliveries.empty?, "No e-mail in delivery list" for delivery in deliveries - for part in delivery.parts + for part in (delivery.parts.empty? ? [delivery] : delivery.parts) if part["Content-Type"].to_s =~ /^text\/html\W/ - root = HTML::Document.new(part.body).root + root = HTML::Document.new(part.body.to_s).root assert_select root, ":root", &block end end |