mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
Ensure ActiveRecord::ConnectionPool.connected? handles undefined connections. [#936 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
This commit is contained in:
committed by
Pratik Naik
parent
5fad229e43
commit
32089cbcc9
@@ -73,6 +73,14 @@ class PooledConnectionsTest < ActiveRecord::TestCase
|
||||
assert ActiveRecord::ConnectionAdapters::AbstractAdapter === conn
|
||||
conn_pool.checkin(conn)
|
||||
end
|
||||
|
||||
def test_undefined_connection_returns_false
|
||||
old_handler = ActiveRecord::Base.connection_handler
|
||||
ActiveRecord::Base.connection_handler = ActiveRecord::ConnectionAdapters::ConnectionHandler.new
|
||||
assert_equal false, ActiveRecord::Base.connected?
|
||||
ensure
|
||||
ActiveRecord::Base.connection_handler = old_handler
|
||||
end
|
||||
end unless %w(FrontBase).include? ActiveRecord::Base.connection.adapter_name
|
||||
|
||||
class AllowConcurrencyDeprecatedTest < ActiveRecord::TestCase
|
||||
|
||||
Reference in New Issue
Block a user