mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
1b9e85dbbd
This reverts commitf93df52845
, reversing changes made toa455e3f4e9
. Conflicts: actionpack/lib/action_controller/test_case.rb actionview/lib/action_view/test_case.rb
22 lines
602 B
Ruby
22 lines
602 B
Ruby
require 'rails-dom-testing'
|
|
|
|
module ActionDispatch
|
|
module Assertions
|
|
autoload :ResponseAssertions, 'action_dispatch/testing/assertions/response'
|
|
autoload :RoutingAssertions, 'action_dispatch/testing/assertions/routing'
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
include ResponseAssertions
|
|
include RoutingAssertions
|
|
include Rails::Dom::Testing::Assertions
|
|
|
|
def html_document
|
|
@html_document ||= if @response.content_type =~ /xml$/
|
|
Nokogiri::XML::Document.parse(@response.body)
|
|
else
|
|
Nokogiri::HTML::Document.parse(@response.body)
|
|
end
|
|
end
|
|
end
|
|
end
|