diff options
Diffstat (limited to 'actionpack/test/new_base')
-rw-r--r-- | actionpack/test/new_base/metal_test.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/actionpack/test/new_base/metal_test.rb b/actionpack/test/new_base/metal_test.rb index c7c45b5cc9..2b7720863a 100644 --- a/actionpack/test/new_base/metal_test.rb +++ b/actionpack/test/new_base/metal_test.rb @@ -1,13 +1,12 @@ require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper") module MetalTest - class MetalMiddleware < ActionController::Metal - def index + class MetalMiddleware < ActionController::Middleware + def call(env) if env["PATH_INFO"] =~ /authed/ - self.response = app.call(env) + app.call(env) else - self.response_body = "Not authed!" - self.status = 401 + [401, headers, "Not authed!"] end end end @@ -21,7 +20,7 @@ module MetalTest class TestMiddleware < ActiveSupport::TestCase def setup @app = Rack::Builder.new do - use MetalMiddleware.middleware(:index) + use MetalMiddleware run Endpoint.new end.to_app end |