aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authorGuo Xiang Tan <tgx_world@hotmail.com>2015-02-19 02:35:51 +0800
committerGuo Xiang Tan <tgx_world@hotmail.com>2015-02-19 08:44:24 +0800
commita39498ae060f07132ddbbc45933a819686f0eb24 (patch)
tree6a6466f299cde51bc1cc38bf1403cedd8144f6ab /railties/test/application
parent28fccad2c4ca8159b1c827026cdd09de9c5a3669 (diff)
downloadrails-a39498ae060f07132ddbbc45933a819686f0eb24.tar.gz
rails-a39498ae060f07132ddbbc45933a819686f0eb24.tar.bz2
rails-a39498ae060f07132ddbbc45933a819686f0eb24.zip
Allow Rack::Runtime to be deleted from middleware stack.
Fixes: https://github.com/rails/rails/issues/16433.
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/middleware_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb
index c64fe082f3..04bd19784a 100644
--- a/railties/test/application/middleware_test.rb
+++ b/railties/test/application/middleware_test.rb
@@ -125,6 +125,22 @@ module ApplicationTests
assert !middleware.include?("ActionDispatch::Static")
end
+ test "can delete a middleware from the stack even if insert_before is added after delete" do
+ add_to_config "config.middleware.delete Rack::Runtime"
+ add_to_config "config.middleware.insert_before(Rack::Runtime, Rack::Config)"
+ boot!
+ assert middleware.include?("Rack::Config")
+ assert_not middleware.include?("Rack::Runtime")
+ end
+
+ test "can delete a middleware from the stack even if insert_after is added after delete" do
+ add_to_config "config.middleware.delete Rack::Runtime"
+ add_to_config "config.middleware.insert_after(Rack::Runtime, Rack::Config)"
+ boot!
+ assert middleware.include?("Rack::Config")
+ assert_not middleware.include?("Rack::Runtime")
+ end
+
test "includes exceptions middlewares even if action_dispatch.show_exceptions is disabled" do
add_to_config "config.action_dispatch.show_exceptions = false"
boot!