Add Rack::Lint to ActionDispatch::MiddlewareStack tests

To ensure Rails is and remains compliant with [the Rack 3 spec](6d16306192/UPGRADE-GUIDE.md) we can add `Rack::Lint` to the Rails middleware tests.

This adds additional test coverage to `ActionDispatch::MiddlewareStack` to validate that its input and output follow the Rack SPEC.

In this case, no changes are required, and the additional test
will ensure this middleware remains compliant with the Rack SPEC.
This commit is contained in:
Nuno Silva 2023-07-27 17:14:58 +00:00
parent 8c23eaa4eb
commit 180cd9f5ac
No known key found for this signature in database
GPG Key ID: 8929D3F4810DC5C0

@ -200,10 +200,14 @@ def test_delete_works
end
ActiveSupport::Notifications.subscribed(subscriber, "process_middleware.action_dispatch") do
app = @stack.build(proc { |env| [200, {}, []] })
app = Rack::Lint.new(
@stack.build(Rack::Lint.new(proc { |env| [200, {}, []] }))
)
env = {}
app.call(env)
env = Rack::MockRequest.env_for("", {})
assert_nothing_raised do
app.call(env)
end
end
assert_equal 2, events.count