diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-07-08 16:36:46 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-07-08 16:36:46 -0700 |
commit | 16e4d013d8a264aed99deeba18d96a1ac541a715 (patch) | |
tree | b3ce722bb52e79a34d8572edf2dc9ff88fe544cf /activerecord/test/cases/scoping/default_scoping_test.rb | |
parent | 2e0b0c1dab7eeafb58d29ac6e71071118c91365f (diff) | |
download | rails-16e4d013d8a264aed99deeba18d96a1ac541a715.tar.gz rails-16e4d013d8a264aed99deeba18d96a1ac541a715.tar.bz2 rails-16e4d013d8a264aed99deeba18d96a1ac541a715.zip |
close our connection when we are done
Diffstat (limited to 'activerecord/test/cases/scoping/default_scoping_test.rb')
-rw-r--r-- | activerecord/test/cases/scoping/default_scoping_test.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/test/cases/scoping/default_scoping_test.rb b/activerecord/test/cases/scoping/default_scoping_test.rb index 5c7751b445..4bcc97ec44 100644 --- a/activerecord/test/cases/scoping/default_scoping_test.rb +++ b/activerecord/test/cases/scoping/default_scoping_test.rb @@ -56,7 +56,10 @@ class DefaultScopingTest < ActiveRecord::TestCase def test_default_scoping_with_threads 2.times do - Thread.new { assert DeveloperOrderedBySalary.all.to_sql.include?('salary DESC') }.join + Thread.new { + assert DeveloperOrderedBySalary.all.to_sql.include?('salary DESC') + DeveloperOrderedBySalary.connection.close + }.join end end @@ -360,9 +363,11 @@ class DefaultScopingTest < ActiveRecord::TestCase threads << Thread.new do Thread.current[:long_default_scope] = true assert_equal 1, ThreadsafeDeveloper.all.to_a.count + ThreadsafeDeveloper.connection.close end threads << Thread.new do assert_equal 1, ThreadsafeDeveloper.all.to_a.count + ThreadsafeDeveloper.connection.close end threads.each(&:join) end |