diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-09-07 05:51:31 -0700 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-09-07 05:51:31 -0700 |
commit | 16f1ce41d5c3b5ab7c95d783f3d32dcc1fc6e485 (patch) | |
tree | 99059c2e2fbeb9c46879d965e131fe9b29cfffe7 /actionpack/lib/action_dispatch/testing | |
parent | fb5dbe8c75e43284af80b7fceb4300980a0be0de (diff) | |
parent | 60d358b23348a14447d176fa51624ad5434eb575 (diff) | |
download | rails-16f1ce41d5c3b5ab7c95d783f3d32dcc1fc6e485.tar.gz rails-16f1ce41d5c3b5ab7c95d783f3d32dcc1fc6e485.tar.bz2 rails-16f1ce41d5c3b5ab7c95d783f3d32dcc1fc6e485.zip |
Merge pull request #2499 from akaspick/assert_select_email_fix
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')
-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 |