aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/test/cases/associations/has_many_through_associations_test.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb
index 608d5a3608..d47c8bba7d 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -18,10 +18,14 @@ require 'models/developer'
class HasManyThroughAssociationsTest < ActiveRecord::TestCase
fixtures :posts, :readers, :people, :comments, :authors, :owners, :pets, :toys, :jobs, :references, :companies
- def test_associate_existing
- assert_queries(2) { posts(:thinking);people(:david) }
+ # Dummies to force column loads so query counts are clean.
+ def setup
+ Person.create :first_name => 'gummy'
+ Reader.create :person_id => 0, :post_id => 0
+ end
- posts(:thinking).people
+ def test_associate_existing
+ assert_queries(2) { posts(:thinking); people(:david) }
assert_queries(1) do
posts(:thinking).people << people(:david)