Permalink
Browse files

Ensure query assertion counts are the same when partial updates are e…

…nabled
  • Loading branch information...
1 parent 2ce1be3 commit 03ba5d7b5183e7cb199a21aa6e06d646f7a5cbfe @jeremy jeremy committed May 30, 2008
@@ -350,6 +350,7 @@ def test_build
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 @@ def test_build_many
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
@@ -59,6 +59,7 @@ def test_associate_new_by_building
# * 2 new records = 4
# + 1 query to save the actual post = 5
assert_queries(5) do
+ posts(:thinking).body += '-changed'
posts(:thinking).save
end

0 comments on commit 03ba5d7

Please sign in to comment.