diff options
author | José Valim <jose.valim@gmail.com> | 2010-07-12 20:18:54 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-07-12 20:18:54 +0200 |
commit | 6b29dc876fe185881d46731c3ae170478a3828fe (patch) | |
tree | e58f6280348e4e80f12fad309d6d8bab9808d2e9 /railties/test/application | |
parent | da84c9d0d243bb3b27748e250cb7ef71df70bb65 (diff) | |
download | rails-6b29dc876fe185881d46731c3ae170478a3828fe.tar.gz rails-6b29dc876fe185881d46731c3ae170478a3828fe.tar.bz2 rails-6b29dc876fe185881d46731c3ae170478a3828fe.zip |
Just add connection management middleware if running in a concurrent environment.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/initializers/frameworks_test.rb | 12 | ||||
-rw-r--r-- | railties/test/application/middleware_test.rb | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb index 4ff10091b1..d8e916f45f 100644 --- a/railties/test/application/initializers/frameworks_test.rb +++ b/railties/test/application/initializers/frameworks_test.rb @@ -98,7 +98,17 @@ module ApplicationTests require "#{app_path}/config/environment" - expects = [ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActiveRecord::SessionStore] + expects = [ActiveRecord::QueryCache, ActiveRecord::SessionStore] + middleware = Rails.application.config.middleware.map { |m| m.klass } + assert_equal expects, middleware & expects + end + + test "database middleware initializes when allow concurrency is true" do + add_to_config "config.threadsafe!" + + require "#{app_path}/config/environment" + + expects = [ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache] middleware = Rails.application.config.middleware.map { |m| m.klass } assert_equal expects, middleware & expects end diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb index e66e81ea2c..ed06b4c767 100644 --- a/railties/test/application/middleware_test.rb +++ b/railties/test/application/middleware_test.rb @@ -28,7 +28,6 @@ module ApplicationTests "ActionDispatch::RemoteIp", "Rack::Sendfile", "ActionDispatch::Callbacks", - "ActiveRecord::ConnectionAdapters::ConnectionManagement", "ActiveRecord::QueryCache", "ActionDispatch::Cookies", "ActionDispatch::Session::CookieStore", |