aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/testing/assertions
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/testing/assertions')
-rw-r--r--actionpack/lib/action_dispatch/testing/assertions/selector.rb4
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)