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:
parent
61a41154f7
commit
175cb7a963
1 changed files with 3 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue