diff options
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/middleware_test.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb index 3e096e99f2..b2443e6503 100644 --- a/railties/test/application/middleware_test.rb +++ b/railties/test/application/middleware_test.rb @@ -56,11 +56,20 @@ module ApplicationTests assert !middleware.include?("Rack::Sendfile"), "Rack::Sendfile is not included in the default stack unless you set config.action_dispatch.x_sendfile_header" end - test "Rack::Cache is present when action_controller.perform_caching is set" do + test "Rack::Cache is not included by default" do add_to_config "config.action_controller.perform_caching = true" boot! + assert !middleware.include?("Rack::Cache"), "Rack::Cache is not included in the default stack unless you set config.action_dispatch.rack_cache" + end + + test "Rack::Cache is present when action_controller.perform_caching is set and action_dispatch.rack_cache is set" do + add_to_config "config.action_controller.perform_caching = true" + add_to_config "config.action_dispatch.rack_cache = true" + + boot! + assert_equal "Rack::Cache", middleware.first end |