aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/middleware_test.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva and Santiago Pastorino <santiago@wyeworks.com>2012-03-05 16:36:27 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2012-03-05 17:49:55 -0200
commitc84d3276def77889fa7b5833ebc51919b349c6ae (patch)
tree8628ee9ab0f978c575e980ae2dba74e9603e681f /railties/test/application/middleware_test.rb
parent9cd927678f7052fdba7bd3f2804327cdd3bd0c64 (diff)
downloadrails-c84d3276def77889fa7b5833ebc51919b349c6ae.tar.gz
rails-c84d3276def77889fa7b5833ebc51919b349c6ae.tar.bz2
rails-c84d3276def77889fa7b5833ebc51919b349c6ae.zip
Add config.middleware.api_only!
Diffstat (limited to 'railties/test/application/middleware_test.rb')
-rw-r--r--railties/test/application/middleware_test.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb
index a1e6066b16..a190a31fc7 100644
--- a/railties/test/application/middleware_test.rb
+++ b/railties/test/application/middleware_test.rb
@@ -52,6 +52,36 @@ module ApplicationTests
], middleware
end
+ test "api middleware stack" do
+ add_to_config "config.middleware.api_only!"
+ add_to_config "config.force_ssl = true"
+ add_to_config "config.action_dispatch.x_sendfile_header = 'X-Sendfile'"
+
+ boot!
+
+ assert_equal [
+ "Rack::SSL",
+ "Rack::Sendfile",
+ "ActionDispatch::Static",
+ "Rack::Lock",
+ "ActiveSupport::Cache::Strategy::LocalCache",
+ "Rack::Runtime",
+ "ActionDispatch::RequestId",
+ "Rails::Rack::Logger",
+ "ActionDispatch::ShowExceptions",
+ "ActionDispatch::DebugExceptions",
+ "ActionDispatch::RemoteIp",
+ "ActionDispatch::Reloader",
+ "ActionDispatch::Callbacks",
+ "ActiveRecord::ConnectionAdapters::ConnectionManagement",
+ "ActiveRecord::QueryCache",
+ "ActionDispatch::ParamsParser",
+ "ActionDispatch::Head",
+ "Rack::ConditionalGet",
+ "Rack::ETag"
+ ], middleware
+ end
+
test "Rack::Sendfile is not included by default" do
boot!