From 5670bbeeb37e55299c85592042fc9170538d8f7b Mon Sep 17 00:00:00 2001 From: Timm Date: Wed, 24 Jul 2013 20:09:06 +0200 Subject: Fixed bug by switching to Loofah fragment instead of document. --- actionpack/lib/action_dispatch/testing/assertions/selector.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_dispatch/testing/assertions/selector.rb') 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) -- cgit v1.2.3