diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-05-30 04:36:00 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-05-30 04:36:00 -0700 |
commit | 03ba5d7b5183e7cb199a21aa6e06d646f7a5cbfe (patch) | |
tree | 9666ddc5c318132a670a2e82a23275d39380e4cc | |
parent | 2ce1be3ac4823ccdfbe36ff5548a562aa5106d2e (diff) | |
download | rails-03ba5d7b5183e7cb199a21aa6e06d646f7a5cbfe.tar.gz rails-03ba5d7b5183e7cb199a21aa6e06d646f7a5cbfe.tar.bz2 rails-03ba5d7b5183e7cb199a21aa6e06d646f7a5cbfe.zip |
Ensure query assertion counts are the same when partial updates are enabled
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/associations/has_many_through_associations_test.rb | 1 |
2 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 cbc621b411..dbfa025efb 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -350,6 +350,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert_equal "Another Client", new_client.name assert new_client.new_record? assert_equal new_client, company.clients_of_firm.last + company.name += '-changed' assert_queries(2) { assert company.save } assert !new_client.new_record? assert_equal 2, company.clients_of_firm(true).size @@ -360,6 +361,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase new_clients = assert_no_queries { company.clients_of_firm.build([{"name" => "Another Client"}, {"name" => "Another Client II"}]) } assert_equal 2, new_clients.size + company.name += '-changed' assert_queries(3) { assert company.save } assert_equal 3, company.clients_of_firm(true).size end 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 5561361bca..05155f6303 100644 --- a/activerecord/test/cases/associations/has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb @@ -59,6 +59,7 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase # * 2 new records = 4 # + 1 query to save the actual post = 5 assert_queries(5) do + posts(:thinking).body += '-changed' posts(:thinking).save end |