From f1031225f67fc3ee23b68c068f31d5099d00f11d Mon Sep 17 00:00:00 2001 From: Timm Date: Wed, 31 Jul 2013 19:48:35 +0200 Subject: Reverted to using documents instead of document fragments, since searching via default xml namespaces didn't work. --- actionpack/lib/action_dispatch/testing/assertions/selector.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 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 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 -- cgit v1.2.3