aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2014-09-29 21:41:52 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2014-09-29 21:41:52 +0200
commitf939904f23a792f5923b5ed683cbbc54a05ad1fe (patch)
tree6d0f10e21b42b7dc012017dfb5ad4f5b57c19192 /actionpack/lib
parent035cc69c48d9d538bded70fc88976cd7f23966f5 (diff)
downloadrails-f939904f23a792f5923b5ed683cbbc54a05ad1fe.tar.gz
rails-f939904f23a792f5923b5ed683cbbc54a05ad1fe.tar.bz2
rails-f939904f23a792f5923b5ed683cbbc54a05ad1fe.zip
Parse HTML as document fragment.
This is to match the changes in Rails Dom Testing rails/rails-dom-testing#20.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/test_case.rb2
-rw-r--r--actionpack/lib/action_dispatch/testing/assertions.rb2
-rw-r--r--actionpack/lib/action_dispatch/testing/integration.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb
index 8c10c3e7b0..41d33d4396 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -689,7 +689,7 @@ module ActionController
private
def document_root_element
- html_document.root
+ html_document
end
def check_required_ivars
diff --git a/actionpack/lib/action_dispatch/testing/assertions.rb b/actionpack/lib/action_dispatch/testing/assertions.rb
index f325c35b57..41d00b5e2b 100644
--- a/actionpack/lib/action_dispatch/testing/assertions.rb
+++ b/actionpack/lib/action_dispatch/testing/assertions.rb
@@ -15,7 +15,7 @@ module ActionDispatch
@html_document ||= if @response.content_type =~ /xml$/
Nokogiri::XML::Document.parse(@response.body)
else
- Nokogiri::HTML::Document.parse(@response.body)
+ Nokogiri::HTML::DocumentFragment.parse(@response.body)
end
end
end
diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb
index 2d1c3ac5c7..c300a4ea0d 100644
--- a/actionpack/lib/action_dispatch/testing/integration.rb
+++ b/actionpack/lib/action_dispatch/testing/integration.rb
@@ -497,7 +497,7 @@ module ActionDispatch
end
def document_root_element
- html_document.root
+ html_document
end
end
end