In the end I did just go into ActionController::TestCase, and this is what I dug out:
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
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…