diff options
author | Timm <kaspth@gmail.com> | 2013-07-24 20:09:06 +0200 |
---|---|---|
committer | Timm <kaspth@gmail.com> | 2014-06-16 21:03:56 +0200 |
commit | 5670bbeeb37e55299c85592042fc9170538d8f7b (patch) | |
tree | 106b64bc6abb1a9d2664788cb08e1adc9c8a046e /actionpack | |
parent | 6f61cf6e78ad0a6400ca226b137b546410bbace4 (diff) | |
download | rails-5670bbeeb37e55299c85592042fc9170538d8f7b.tar.gz rails-5670bbeeb37e55299c85592042fc9170538d8f7b.tar.bz2 rails-5670bbeeb37e55299c85592042fc9170538d8f7b.zip |
Fixed bug by switching to Loofah fragment instead of document.
Diffstat (limited to 'actionpack')
-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 615f68e622..1d72dc1513 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb @@ -282,7 +282,7 @@ module ActionDispatch deliveries.each do |delivery| (delivery.parts.empty? ? [delivery] : delivery.parts).each do |part| if part["Content-Type"].to_s =~ /^text\/html\W/ - root = Loofah.document(part.body.to_s).root + root = Loofah.fragment(part.body.to_s) assert_select root, ":root", &block end end @@ -443,7 +443,7 @@ module ActionDispatch end def match(matches, attribute, id) - matches.find_all { |node| node[attribute] =~ @regexes[id] } + matches.find_all { |node| node[attribute] =~ @regexes[id.to_i] } end def substitute!(selector, values) |