diff options
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/middleware_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb index 1b9c8c30fc..df564011d3 100644 --- a/railties/test/application/middleware_test.rb +++ b/railties/test/application/middleware_test.rb @@ -55,6 +55,18 @@ module ApplicationTests assert_equal "Rack::Config", middleware.last end + test "insert middleware after" do + add_to_config "config.middleware.insert_after ActionDispatch::Static, Rack::Config" + boot! + assert_equal "Rack::Config", middleware.second + end + + test "insert middleware before" do + add_to_config "config.middleware.insert_before ActionDispatch::Static, Rack::Config" + boot! + assert_equal "Rack::Config", middleware.first + end + private def boot! require "#{app_path}/config/environment" |