In the end, I just went into ActionController :: TestCase, and this is what I dug up:
def get_content host, path, filename request = ActionController::Request.new 'HTTP_HOST' => host, 'REQUEST_URI' => path, 'REQUEST_METHOD' => 'GET', 'rack.input' => '', 'rack.url_scheme' => 'http' controller = ActionController::Routing::Routes.recognize(request).new response = ActionController::Response.new controller.process request, response return response.body end
source share