module ActionView::TestCase::Behavior
Inherits From
-
module
Rails::
Dom:: Testing:: Assertions -
module
ActionView::
Context -
module
ActionDispatch::
Routing:: PolymorphicRoutes -
module
AbstractController::
Helpers -
module
ActionView::
Helpers -
module
ActionView::
RecordIdentifier -
module
ActionView::
RoutingUrlFor -
module
ActiveSupport::
Testing:: ConstantLookup
Constants
[
:@NAME,
:@failures,
:@assertions,
:@__io__,
:@_assertion_wrapped,
:@_assertions,
:@_result,
:@_routes,
:@controller,
:@_controller,
:@_request,
:@_config,
:@_default_form_builder,
:@_layouts,
:@_files,
:@_rendered_views,
:@method_name,
:@output_buffer,
:@_partials,
:@passed,
:@rendered,
:@request,
:@routes,
:@tagged_logger,
:@_templates,
:@options,
:@test_passed,
:@view,
:@view_context_class,
:@view_flow,
:@_subscribers,
:@html_document,
]
Attributes
[RW] | controller |
|
[RW] | output_buffer |
|
[RW] | rendered |
Returns the content rendered by the last The returned object behaves like a string but also exposes a number of methods that allows you to parse the content string in formats registered using By default includes the following parsers:
Parse the
To parse the rendered content into a
Parse the
|
[RW] | request |
Public instance methods
Source code GitHub
# File actionview/lib/action_view/test_case.rb, line 295
def _routes
@controller._routes if @controller.respond_to?(:_routes)
end
Source code GitHub
# File actionview/lib/action_view/test_case.rb, line 263
def _test_case
controller._test_case
end
Source code GitHub
# File actionview/lib/action_view/test_case.rb, line 281
def config
@controller.config if @controller.respond_to?(:config)
end
Source code GitHub
# File actionview/lib/action_view/test_case.rb, line 259
def protect_against_forgery?
false
end
Source code GitHub
# File actionview/lib/action_view/test_case.rb, line 285
def render(options = {}, local_assigns = {}, &block)
view.assign(view_assigns)
@rendered << output = view.render(options, local_assigns, &block)
output
end
Source code GitHub
# File actionview/lib/action_view/test_case.rb, line 291
def rendered_views
@_rendered_views ||= RenderedViewsCollection.new
end
Source code GitHub
# File actionview/lib/action_view/test_case.rb, line 269
def setup_with_controller
controller_class = Class.new(ActionView::TestCase::TestController)
@controller = controller_class.new
@request = @controller.request
@view_flow = ActionView::OutputFlow.new
@output_buffer = ActionView::OutputBuffer.new
@rendered = self.class.content_class.new(+"")
test_case_instance = self
controller_class.define_method(:_test_case) { test_case_instance }
end