aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/testing/assertions/selector.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/testing/assertions/selector.rb')
-rw-r--r--actionpack/lib/action_dispatch/testing/assertions/selector.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb
index 504eccd0a7..e551851ed6 100644
--- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb
+++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb
@@ -296,12 +296,15 @@ module ActionDispatch
# +html_document+ is used in testing/integration.rb
def html_document
@html_document ||= if @response.content_type =~ /xml$/
- Loofah.xml_fragment(@response.body)
+ Loofah.xml_document(@response.body)
else
- Loofah.fragment(@response.body)
+ Loofah.document(@response.body)
end
end
- alias :response_from_page :html_document
+
+ def response_from_page
+ html_document.root
+ end
class HTMLSelector #:nodoc:
attr_accessor :root, :css_selector, :comparisons, :message