aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2010-03-15 11:00:11 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2010-03-15 11:00:25 -0700
commit30f5f955448c67aaa6a92b7e1704aa837aa536f8 (patch)
treee861f9bbc427b6f98c54f096c67b7f5442794cd9
parent5de3698e2be1438d0fdc2b4ef2fe6adf0b94b343 (diff)
downloadrails-30f5f955448c67aaa6a92b7e1704aa837aa536f8.tar.gz
rails-30f5f955448c67aaa6a92b7e1704aa837aa536f8.tar.bz2
rails-30f5f955448c67aaa6a92b7e1704aa837aa536f8.zip
Hack to keep column metadata queries out of test query counts
-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)