Namespace
Module
Class
Methods
Included Modules
- Rails::Dom::Testing::Assertions
- ActionView::Context
- ActionDispatch::Routing::PolymorphicRoutes
- AbstractController::Helpers
- ActionView::Helpers
- ActionView::RecordIdentifier
- ActionView::RoutingUrlFor
- ActiveSupport::Testing::ConstantLookup
Constants
INTERNAL_IVARS | = | [ :@NAME, :@failures, :@assertions, :@__io__, :@_assertion_wrapped, :@_assertions, :@_result, :@_routes, :@controller, :@_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 |
Instance Public methods
_routes()
📝 Source code
# File actionview/lib/action_view/test_case.rb, line 132
def _routes
@controller._routes if @controller.respond_to?(:_routes)
end
🔎 See on GitHub
_test_case()
📝 Source code
# File actionview/lib/action_view/test_case.rb, line 171
def _test_case
controller._test_case
end
🔎 See on GitHub
config()
📝 Source code
# File actionview/lib/action_view/test_case.rb, line 118
def config
@controller.config if @controller.respond_to?(:config)
end
🔎 See on GitHub
protect_against_forgery?()
📝 Source code
# File actionview/lib/action_view/test_case.rb, line 167
def protect_against_forgery?
false
end
🔎 See on GitHub
render(options = {}, local_assigns = {}, &block)
📝 Source code
# File actionview/lib/action_view/test_case.rb, line 122
def render(options = {}, local_assigns = {}, &block)
view.assign(view_assigns)
@rendered << output = view.render(options, local_assigns, &block)
output
end
🔎 See on GitHub
rendered_views()
📝 Source code
# File actionview/lib/action_view/test_case.rb, line 128
def rendered_views
@_rendered_views ||= RenderedViewsCollection.new
end
🔎 See on GitHub
setup_with_controller()
📝 Source code
# File actionview/lib/action_view/test_case.rb, line 104
def setup_with_controller
controller_class = Class.new(ActionView::TestCase::TestController)
@controller = controller_class.new
@request = @controller.request
@view_flow = ActionView::OutputFlow.new
# empty string ensures buffer has UTF-8 encoding as
# new without arguments returns ASCII-8BIT encoded buffer like String#new
@output_buffer = ActiveSupport::SafeBuffer.new ""
@rendered = +""
test_case_instance = self
controller_class.define_method(:_test_case) { test_case_instance }
end
🔎 See on GitHub