Module: ActionDispatch::Assertions

Extended by:
ActiveSupport::Concern
Includes:
ResponseAssertions, RoutingAssertions, Rails::Dom::Testing::Assertions
Included in:
Integration::Runner, Integration::Session, ActionView::TestCase::Behavior
Defined in:
actionpack/lib/action_dispatch/testing/assertions.rb,
actionpack/lib/action_dispatch/testing/assertions/routing.rb,
actionpack/lib/action_dispatch/testing/assertions/response.rb

Defined Under Namespace

Modules: ResponseAssertions, RoutingAssertions

Constant Summary

Constants included from ResponseAssertions

ResponseAssertions::RESPONSE_PREDICATES

Instance Method Summary collapse

Methods included from ActiveSupport::Concern

append_features, class_methods, extended, included

Methods included from RoutingAssertions

#assert_generates, #assert_recognizes, #assert_routing, #method_missing, #setup, #with_routing

Methods included from ResponseAssertions

#assert_redirected_to, #assert_response

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ActionDispatch::Assertions::RoutingAssertions

Instance Method Details

#html_documentObject


16
17
18
19
20
21
22
# File 'actionpack/lib/action_dispatch/testing/assertions.rb', line 16

def html_document
  @html_document ||= if @response.media_type.to_s.end_with?("xml")
    Nokogiri::XML::Document.parse(@response.body)
  else
    Nokogiri::HTML::Document.parse(@response.body)
  end
end