Module: ActionDispatch::Assertions

Extended by:
ActiveSupport::Concern
Includes:
ResponseAssertions, RoutingAssertions, Rails::Dom::Testing::Assertions
Included in:
Integration::Runner, Integration::Session
Defined in:
lib/action_dispatch/testing/assertions.rb,
lib/action_dispatch/testing/assertions/routing.rb,
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 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



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

def html_document
  @html_document ||= if @response.media_type&.end_with?("xml")
    Nokogiri::XML::Document.parse(@response.body)
  else
    Rails::Dom::Testing.html_document.parse(@response.body)
  end
end