1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix metal tests

This commit is contained in:
Joshua Peek 2008-12-17 10:10:24 -06:00
parent 61a41154f7
commit 175cb7a963

View file

@ -374,16 +374,12 @@ class IntegrationProcessTest < ActionController::IntegrationTest
end
class MetalTest < ActionController::IntegrationTest
require(File.dirname(__FILE__) + "/../../../railties/lib/rails/rack/metal.rb")
class Poller < ::Rails::Rack::Metal
def call(env)
class Poller
def self.call(env)
if env["PATH_INFO"] =~ /^\/success/
[200, {"Content-Type" => "text/plain"}, "Hello World!"]
elsif env["PATH_INFO"] =~ /^\/failure/
[404, {"Content-Type" => "text/plain"}, '']
else
super
[404, {"Content-Type" => "text/plain"}, '']
end
end
end