diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-07-26 00:18:56 -0300 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:16 -0700 |
commit | 34ca9c122c26dc3e073e52ecdf267cb23885c1df (patch) | |
tree | f144b1eff8098e29398a5d79b6b919ca756e3156 /railties/test | |
parent | cd5f54cfb6ab184659e6e86c6803e4b2915b7271 (diff) | |
download | rails-34ca9c122c26dc3e073e52ecdf267cb23885c1df.tar.gz rails-34ca9c122c26dc3e073e52ecdf267cb23885c1df.tar.bz2 rails-34ca9c122c26dc3e073e52ecdf267cb23885c1df.zip |
Check that Rack::Sendfile is not included unless config.action_dispatch.x_sendfile_header is set
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/middleware_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb index 6a0a272073..bed5ba503f 100644 --- a/railties/test/application/middleware_test.rb +++ b/railties/test/application/middleware_test.rb @@ -20,6 +20,8 @@ module ApplicationTests end test "default middleware stack" do + add_to_config "config.action_dispatch.x_sendfile_header = 'X-Sendfile'" + boot! assert_equal [ @@ -47,6 +49,12 @@ module ApplicationTests ], middleware end + test "Rack::Sendfile is not included by default" do + boot! + + 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 add_to_config "config.action_controller.perform_caching = true" |