setup_controller_request_and_response() 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 657
      def setup_controller_request_and_response
        @controller = nil unless defined? @controller

        response_klass = TestResponse

        if klass = self.class.controller_class
          if klass < ActionController::Live
            response_klass = LiveTestResponse
          end
          unless @controller
            begin
              @controller = klass.new
            rescue
              warn "could not construct controller #{klass}" if $VERBOSE
            end
          end
        end

        @request          = build_request
        @response         = build_response response_klass
        @response.request = @request

        if @controller
          @controller.request = @request
          @controller.params = {}
        end
      end
Register or log in to add new notes.