vendor/plugins/rspec-rails/lib/spec/rails/example/view_example_group.rb
# Renders a template for a View Spec, which then provides access to the result
# through the +response+. Also supports render with :inline, which you can
# use to spec custom form builders, helpers, etc, in the context of a view.
#
# == Examples
#
#   render('/people/list')
#   render('/people/list', :helper => MyHelper)
#   render('/people/list', :helpers => [MyHelper, MyOtherHelper])
#   render(:partial => '/people/_address')
#   render(:inline => "<% custom_helper 'argument', 'another argument' %>")
#
# See Spec::Rails::Example::ViewExampleGroup for more information.
Renders a template for a View Spec, which then provides access to the result
through the +response+. Also supports render with :inline, which you can
use to spec custom form builders, helpers, etc, in the context of a view.

Examples




Renders a template for a View Spec which then provides access to the result through the + response + . Also supports render with : inline which you can use to spec custom form builders helpers etc in the context of a view . Examples
def render(*args)
          options = Hash === args.last ? args.pop : {}
          options[:template] = args.first.to_s unless args.empty?
          set_base_view_path(options)
          add_helpers(options)
          assigns[:action_name] = @action_name
          @request.path_parameters = {
          :controller => derived_controller_name(options),
          :action => derived_action_name(options)
          }
          defaults = { :layout => false }
          options = defaults.merge options
          @controller.send(:params).reverse_merge! @request.parameters
          @controller.send :initialize_current_url
          @controller.class.instance_eval %{
            def controller_path
              "#{derived_controller_name(options)}"
            end
            def controller_name
              "#{derived_controller_name(options).split('/').last}"
            end
          }
          @controller.send :forget_variables_added_to_assigns
          @controller.send :render, options
          @controller.send :process_cleanup
        end
def render ( * args ) options = Hash === args . last ? args . pop : { } options [ :template ] = args . first . to_s unless args . empty? set_base_view_path ( options ) add_helpers ( options ) assigns [ :action_name ] = @action_name @request . path_parameters = { :controller => derived_controller_name ( options ) , :action => derived_action_name ( options ) } defaults = { :layout => false } options = defaults . merge options @controller . send ( :params ) . reverse_merge! @request . parameters @controller . send :initialize_current_url @controller . class . instance_eval %{
            def controller_path
              "#{derived_controller_name(options)}"
            end

            def controller_name
              "#{derived_controller_name(options).split('/').last}"
            end
          } @controller . send :forget_variables_added_to_assigns @controller . send :render , options @controller . send :process_cleanup end
Renders a template for a View Spec, which then provides access to the result
through the +response+.
Renders a template for a View Spec which then provides access to the result through the + response + .
args
<not_specific>