diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2012-10-03 16:43:39 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2012-10-04 21:36:00 -0500 |
commit | 586a991830329dd96c0755c61af5723b613bf2fb (patch) | |
tree | 3a62ad49ab17ea906227c7ed4697e0858d861da2 /railties/test | |
parent | 4b33bbc80374e486467f9a7b76e34e4ab2ce0b50 (diff) | |
download | rails-586a991830329dd96c0755c61af5723b613bf2fb.tar.gz rails-586a991830329dd96c0755c61af5723b613bf2fb.tar.bz2 rails-586a991830329dd96c0755c61af5723b613bf2fb.zip |
config.action_dispatch.rack_cache should set explicitly to enable Rack::Cache
Diffstat (limited to 'railties/test')
-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 |