module ActionView::TestCase::Behavior

def _assigns

def _assigns
  ActiveSupport::Deprecation.warn "ActionView::TestCase#_assigns is deprecated and will be removed in future versions. " <<
    "Please use view_assigns instead."
  view_assigns
end

def _routes

def _routes
  @controller._routes if @controller.respond_to?(:_routes)
end

def _user_defined_ivars

def _user_defined_ivars
  instance_variables.map(&:to_s) - INTERNAL_IVARS
end

def config

def config
  @controller.config if @controller.respond_to?(:config)
end

def locals

def locals
  @locals ||= {}
end

def make_test_case_available_to_view!

def make_test_case_available_to_view!
  test_case_instance = self
  _helpers.module_eval do
    define_method(:_test_case) { test_case_instance }
    private :_test_case
  end
end

def method_missing(selector, *args)

def method_missing(selector, *args)
  if @controller.respond_to?(:_routes) &&
  @controller._routes.named_routes.helpers.include?(selector)
    @controller.__send__(selector, *args)
  else
    super
  end
end

def protect_against_forgery?

def protect_against_forgery?
  false
end

def render(options = {}, local_assigns = {}, &block)

def render(options = {}, local_assigns = {}, &block)
  view.assign(view_assigns)
  @rendered << output = view.render(options, local_assigns, &block)
  output
end

def response_from_page_or_rjs

Need to experiment if this priority is the best one: rendered => output_buffer

Support the selector assertions
def response_from_page_or_rjs
  HTML::Document.new(@rendered.blank? ? @output_buffer : @rendered).root
end

def say_no_to_protect_against_forgery!

def say_no_to_protect_against_forgery!
  _helpers.module_eval do
    def protect_against_forgery?
      false
    end
  end
end

def setup_with_controller

def setup_with_controller
  @controller = ActionView::TestCase::TestController.new
  @request = @controller.request
  @output_buffer = ActiveSupport::SafeBuffer.new
  @rendered = ''
  make_test_case_available_to_view!
  say_no_to_protect_against_forgery!
end

def view

The instance of ActionView::Base that is used by +render+.
def view
  @view ||= begin
               view = @controller.view_context
               view.singleton_class.send :include, _helpers
               view.extend(Locals)
               view.locals = self.locals
               view.output_buffer = self.output_buffer
               view
             end
end

def view_assigns

frameworks.
rendered. This is generally intended for internal use and extension
the user in the test case, which are then assigned to the view being
Returns a Hash of instance variables and their values, as defined by
def view_assigns
  Hash[_user_defined_ivars.map do |var|
    [var[1..-1].to_sym, instance_variable_get(var)]
  end]
end