diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2017-05-28 17:11:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-28 17:11:38 +0200 |
commit | 61413b592dbbd6d7adbcb16fb95f760b0656cd9b (patch) | |
tree | 0c47aa88678c5d359152f0140276c6b3e1abb175 | |
parent | bbf077363e2d200c529e4c6feba924a9537433c6 (diff) | |
parent | 21e0b675c3cef207c8c4c79a8b580c2d6c138cfa (diff) | |
download | rails-61413b592dbbd6d7adbcb16fb95f760b0656cd9b.tar.gz rails-61413b592dbbd6d7adbcb16fb95f760b0656cd9b.tar.bz2 rails-61413b592dbbd6d7adbcb16fb95f760b0656cd9b.zip |
Merge pull request #29071 from y-yagi/fix_default_scoping_test
Explicitly create necessary data for test
-rw-r--r-- | activerecord/test/cases/scoping/default_scoping_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/scoping/default_scoping_test.rb b/activerecord/test/cases/scoping/default_scoping_test.rb index 89fb434b27..6f1010d701 100644 --- a/activerecord/test/cases/scoping/default_scoping_test.rb +++ b/activerecord/test/cases/scoping/default_scoping_test.rb @@ -486,6 +486,8 @@ class DefaultScopingWithThreadTest < ActiveRecord::TestCase end def test_default_scope_is_threadsafe + 2.times { ThreadsafeDeveloper.unscoped.create! } + threads = [] assert_not_equal 1, ThreadsafeDeveloper.unscoped.count @@ -504,5 +506,7 @@ class DefaultScopingWithThreadTest < ActiveRecord::TestCase ThreadsafeDeveloper.connection.close end threads.each(&:join) + ensure + ThreadsafeDeveloper.unscoped.destroy_all end end unless in_memory_db? |