123456789_123456789_123456789_123456789_123456789_

Module: ActionDispatch::Assertions

Relationships & Source Files
Namespace Children
Modules:
Extension / Inclusion / Inheritance Descendants
Included In:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
self, Rails::Dom::Testing::Assertions, RoutingAssertions, ResponseAssertions
Defined in: actionpack/lib/action_dispatch/testing/assertions.rb,
actionpack/lib/action_dispatch/testing/assertions/response.rb,
actionpack/lib/action_dispatch/testing/assertions/routing.rb

Class Method Summary

Instance Method Summary

RoutingAssertions - Included

#assert_generates

Asserts that the provided options can be used to generate the provided path.

#assert_recognizes

Asserts that the routing of the given path was handled correctly and that the parsed options (given in the expected_options hash) match path.

#assert_routing

Asserts that path and options match both ways; in other words, it verifies that path generates options and then that options generates path.

#method_missing

ROUTES TODO: These assertions should really work in an integration context.

#with_routing

A helper to make it easier to test different route configurations.

ResponseAssertions - Included

#assert_redirected_to

Assert that the redirection options passed in match those of the redirect called in the latest action.

#assert_response

Asserts that the response is one of the following types:

Dynamic Method Handling

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

Instance Method Details

#html_document

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/testing/assertions.rb', line 14

def html_document
  @html_document ||= if @response.content_type.to_s =~ /xml$/
    Nokogiri::XML::Document.parse(@response.body)
  else
    Nokogiri::HTML::Document.parse(@response.body)
  end
end