提交 30f5f955 编写于 作者: J Jeremy Kemper

Hack to keep column metadata queries out of test query counts

上级 5de3698e
...@@ -18,10 +18,14 @@ ...@@ -18,10 +18,14 @@
class HasManyThroughAssociationsTest < ActiveRecord::TestCase class HasManyThroughAssociationsTest < ActiveRecord::TestCase
fixtures :posts, :readers, :people, :comments, :authors, :owners, :pets, :toys, :jobs, :references, :companies fixtures :posts, :readers, :people, :comments, :authors, :owners, :pets, :toys, :jobs, :references, :companies
def test_associate_existing # Dummies to force column loads so query counts are clean.
assert_queries(2) { posts(:thinking);people(:david) } 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 assert_queries(1) do
posts(:thinking).people << people(:david) posts(:thinking).people << people(:david)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册