private Method

RoutingAssertions.recognized_request_for(path, request_method = nil)

Recognizes the route for a given path.

Source Code

# File 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
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.