aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2015-04-16 14:55:32 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2015-06-11 16:54:09 -0300
commit135c059d6f0664991f158d358a4312e550ead7a6 (patch)
treee0eea551cb6d77d17b01ca6b52b2d2a46d7ca295 /railties/test/application
parent2d86b6d9aec6c46fb6c85a4c504cae48d77c2564 (diff)
downloadrails-135c059d6f0664991f158d358a4312e550ead7a6.tar.gz
rails-135c059d6f0664991f158d358a4312e550ead7a6.tar.bz2
rails-135c059d6f0664991f158d358a4312e550ead7a6.zip
Add config.api_only option to application and remove appropriate middleware when true
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/middleware_test.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb
index 04bd19784a..ce92ebbf66 100644
--- a/railties/test/application/middleware_test.rb
+++ b/railties/test/application/middleware_test.rb
@@ -50,6 +50,33 @@ module ApplicationTests
], middleware
end
+ test "api middleware stack" do
+ add_to_config "config.api_only = true"
+
+ boot!
+
+ assert_equal [
+ "Rack::Sendfile",
+ "ActionDispatch::Static",
+ "Rack::Lock",
+ "ActiveSupport::Cache::Strategy::LocalCache",
+ "Rack::Runtime",
+ "ActionDispatch::RequestId",
+ "Rails::Rack::Logger", # must come after Rack::MethodOverride to properly log overridden methods
+ "ActionDispatch::ShowExceptions",
+ "ActionDispatch::DebugExceptions",
+ "ActionDispatch::RemoteIp",
+ "ActionDispatch::Reloader",
+ "ActionDispatch::Callbacks",
+ "ActiveRecord::ConnectionAdapters::ConnectionManagement",
+ "ActiveRecord::QueryCache",
+ "ActionDispatch::ParamsParser",
+ "Rack::Head",
+ "Rack::ConditionalGet",
+ "Rack::ETag"
+ ], middleware
+ end
+
test "Rack::Cache is not included by default" do
boot!