aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/has_many_associations_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/associations/has_many_associations_test.rb')
-rw-r--r--activerecord/test/cases/associations/has_many_associations_test.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb
index 8b384c2513..fe64692df6 100644
--- a/activerecord/test/cases/associations/has_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_associations_test.rb
@@ -1339,6 +1339,9 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
author = Author.new(:name => "David")
assert !author.essays.loaded?
+ # cache metadata in advance to avoid extra sql statements executed while testing
+ Essay.first
+
assert_queries 1 do
assert_equal 1, author.essays.size
end