Browse files

Rack::Sendfile is now included in middleware by default, change tests…

… to reflect that
  • Loading branch information...
1 parent 207fa5c commit 0b61cc730ee1fd2b40acac5886a62ea91c0b3d51 @guilleiguaran guilleiguaran committed Jul 15, 2013
Showing with 4 additions and 10 deletions.
  1. +4 −10 railties/test/application/middleware_test.rb
View
14 railties/test/application/middleware_test.rb
@@ -49,12 +49,6 @@ def app
], 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 not included by default" do
boot!
@@ -143,24 +137,24 @@ def app
end
test "insert middleware after" do
- add_to_config "config.middleware.insert_after ActionDispatch::Static, Rack::Config"
+ add_to_config "config.middleware.insert_after Rack::Sendfile, Rack::Config"
boot!
assert_equal "Rack::Config", middleware.second
end
test "Rails.cache does not respond to middleware" do
add_to_config "config.cache_store = :memory_store"
boot!
- assert_equal "Rack::Runtime", middleware.third
+ assert_equal "Rack::Runtime", middleware.fourth
end
test "Rails.cache does respond to middleware" do
boot!
- assert_equal "Rack::Runtime", middleware.fourth
+ assert_equal "Rack::Runtime", middleware.fifth
end
test "insert middleware before" do
- add_to_config "config.middleware.insert_before ActionDispatch::Static, Rack::Config"
+ add_to_config "config.middleware.insert_before Rack::Sendfile, Rack::Config"
boot!
assert_equal "Rack::Config", middleware.first
end

1 comment on commit 0b61cc7

@prathamesh-sonpatki
Ruby on Rails member

@guilleiguaran What do you think about dependency of these tests on the order of middlewares? If the order changes again or some other middleware is added or removed these tests will break again.

I was able to change it for before and after insert tests

prathamesh-sonpatki@f62ddb6#L0R148
prathamesh-sonpatki@f62ddb6#L0L165

Please sign in to comment.