aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/threaded_connections_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/threaded_connections_test.rb')
-rw-r--r--activerecord/test/cases/threaded_connections_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/threaded_connections_test.rb b/activerecord/test/cases/threaded_connections_test.rb
index a9d82037bc..892a99f85a 100644
--- a/activerecord/test/cases/threaded_connections_test.rb
+++ b/activerecord/test/cases/threaded_connections_test.rb
@@ -105,5 +105,15 @@ unless %w(FrontBase).include? ActiveRecord::Base.connection.adapter_name
assert_equal 3, @connection_count
assert_equal 0, @timed_out
end
+
+ def test_pooled_connection_checkout_existing_first
+ ActiveRecord::Base.establish_connection(@connection.merge({:pool => 1}))
+ conn_pool = ActiveRecord::Base.connection_pool
+ conn = conn_pool.checkout
+ conn_pool.checkin(conn)
+ conn = conn_pool.checkout
+ assert ActiveRecord::ConnectionAdapters::AbstractAdapter === conn
+ conn_pool.checkin(conn)
+ end
end
end