aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-02-04 18:08:31 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-02-04 18:14:59 -0800
commit59f7780a3454a14054d1d33d9b6e31192ab2e58b (patch)
tree03f0318134781173b87959dcdd21c1ac0bd4eeda /activerecord/test/cases/associations
parentacccb72cb12ab55bb01c3dce32f54f4a59ebec6c (diff)
downloadrails-59f7780a3454a14054d1d33d9b6e31192ab2e58b.tar.gz
rails-59f7780a3454a14054d1d33d9b6e31192ab2e58b.tar.bz2
rails-59f7780a3454a14054d1d33d9b6e31192ab2e58b.zip
adjust query counts to be consistent across databases, make sure database log the same things
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r--activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
index 55b611ca92..126b767d06 100644
--- a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
@@ -757,10 +757,13 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase
david = Developer.find(1)
# clear cache possibly created by other tests
david.projects.reset_column_information
- assert_queries(0) { david.projects.columns; david.projects.columns }
- # and again to verify that reset_column_information clears the cache correctly
+
+ # One query for columns, one for primary key
+ assert_queries(2) { david.projects.columns; david.projects.columns }
+
+ ## and again to verify that reset_column_information clears the cache correctly
david.projects.reset_column_information
- assert_queries(0) { david.projects.columns; david.projects.columns }
+ assert_queries(2) { david.projects.columns; david.projects.columns }
end
def test_attributes_are_being_set_when_initialized_from_habm_association_with_where_clause