Flowdock
method

process

Importance_0
v4.0.2 - Show latest stable - 0 notes - Class: ActionController::TestCase::Behavior
process(action, http_method = 'GET', *args) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_controller/test_case.rb, line 525
      def process(action, http_method = 'GET', *args)
        check_required_ivars
        http_method, args = handle_old_process_api(http_method, args, caller)

        if args.first.is_a?(String) && http_method != 'HEAD'
          @request.env['RAW_POST_DATA'] = args.shift
        end

        parameters, session, flash = args

        # Ensure that numbers and symbols passed as params are converted to
        # proper params, as is the case when engaging rack.
        parameters = paramify_values(parameters) if html_format?(parameters)

        @html_document = nil

        unless @controller.respond_to?(:recycle!)
          @controller.extend(Testing::Functional)
          @controller.class.class_eval { include Testing }
        end

        @request.recycle!
        @response.recycle!
        @controller.recycle!

        @request.env['REQUEST_METHOD'] = http_method

        parameters ||= {}
        controller_class_name = @controller.class.anonymous? ?
          "anonymous" :
          @controller.class.controller_path

        @request.assign_parameters(@routes, controller_class_name, action.to_s, parameters)

        @request.session.update(session) if session
        @request.flash.update(flash || {})

        @controller.request  = @request
        @controller.response = @response

        build_request_uri(action, parameters)

        name = @request.parameters[:action]

        @controller.process(name)

        if cookies = @request.env['action_dispatch.cookies']
          cookies.write(@response)
        end
        @response.prepare!

        @assigns = @controller.respond_to?(:view_assigns) ? @controller.view_assigns : {}
        @request.session['flash'] = @request.flash.to_session_value
        @request.session.delete('flash') if @request.session['flash'].blank?
        @response
      end
Register or log in to add new notes.