Skip to content

Commit ab177d8

Browse files
author
David Heinemeier Hansson
committed
Fix broken delete_all test, which will now be failing since #delete_all is broken
1 parent e562dde commit ab177d8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

activerecord/test/cases/associations/has_many_associations_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -785,10 +785,10 @@ def test_delete_all
785785
companies(:first_firm).clients_of_firm.create("name" => "Another Client")
786786
clients = companies(:first_firm).clients_of_firm.to_a
787787
assert_equal 2, clients.count
788-
deleted = companies(:first_firm).clients_of_firm.delete_all
789-
assert_equal clients.sort_by(&:id), deleted.sort_by(&:id)
790-
assert_equal 0, companies(:first_firm).clients_of_firm.size
791-
assert_equal 0, companies(:first_firm).clients_of_firm(true).size
788+
789+
assert_difference "Client.count", -(clients.count) do
790+
companies(:first_firm).clients_of_firm.delete_all
791+
end
792792
end
793793

794794
def test_delete_all_with_not_yet_loaded_association_collection

0 commit comments

Comments
 (0)