aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimm <kaspth@gmail.com>2013-07-25 20:03:28 +0200
committerTimm <kaspth@gmail.com>2014-06-16 21:03:56 +0200
commit2cc4f4258a61dd638da2f72d27b26753a72f886f (patch)
tree99f304fd79df161032f903404872d77fae3ae7ca
parenta5eeec4858dce378c166ce58abe08b7dcc2ae440 (diff)
downloadrails-2cc4f4258a61dd638da2f72d27b26753a72f886f.tar.gz
rails-2cc4f4258a61dd638da2f72d27b26753a72f886f.tar.bz2
rails-2cc4f4258a61dd638da2f72d27b26753a72f886f.zip
Changed html_document to use fragments. Changed response_from_page to be an alias of html_document.
-rw-r--r--actionpack/lib/action_dispatch/testing/assertions/selector.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb
index 1d72dc1513..53e7675f7c 100644
--- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb
+++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb
@@ -323,18 +323,15 @@ module ActionDispatch
end
end
- def response_from_page
- html_document.root
- end
-
# +html_document+ is used in testing/integration.rb
def html_document
@html_document ||= if @response.content_type =~ /xml$/
- Loofah.xml_document(@response.body)
+ Loofah.xml_fragment(@response.body)
else
- Loofah.document(@response.body)
+ Loofah.fragment(@response.body)
end
end
+ alias :response_from_page :html_document
class HTMLSelector #:nodoc:
attr_accessor :root, :css_selector, :comparisons, :message