instance method recognized_request_for

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v2.3.18 Private

Available in: v2.2.3 v2.3.18

Signature

recognized_request_for(path, request_method = nil)

Recognizes the route for a given path.

Parameters

path req
request_method opt = nil
Source
# File actionpack/lib/action_controller/assertions/routing_assertions.rb, line 133
        def recognized_request_for(path, request_method = nil)
          path = "/#{path}" unless path.first == '/'

          # Assume given controller
          request = ActionController::TestRequest.new({}, {}, nil)
          request.env["REQUEST_METHOD"] = request_method.to_s.upcase if request_method
          request.path   = path

          ActionController::Routing::Routes.recognize(request)
          request
        end

Defined in actionpack/lib/action_controller/assertions/routing_assertions.rb line 133 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionController::Assertions::RoutingAssertions

Type at least 2 characters to search.

↑↓ navigate · open · esc close