提交 9efdffe4 编写于 作者: T Timm

Moved html_document to ActionDispatch::Assertions. Included the...

Moved html_document to ActionDispatch::Assertions. Included the Rails::Dom::Testing::Assertions there as well.
上级 50347b15
......@@ -684,14 +684,9 @@ def build_response(klass)
private
def document_root_element
@html_document ||= if @response.content_type =~ /xml$/
Loofah.xml_document(@response.body)
else
Loofah.document(@response.body)
end.root
html_document.root
end
def check_required_ivars
# Sanity check for required instance variables so we can give an
# understandable error message.
......
require 'loofah'
require 'rails-dom-testing'
module ActionDispatch
module Assertions
autoload :ResponseAssertions, 'action_dispatch/testing/assertions/response'
......@@ -7,6 +10,14 @@ module Assertions
include ResponseAssertions
include RoutingAssertions
include Rails::Dom::Testing::Assertions
def html_document
@html_document ||= if @response.content_type =~ /xml$/
Loofah.xml_document(@response.body)
else
Loofah.document(@response.body)
end
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册