Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix broken delete_all test, which will now be failing since #delete_a…

…ll is broken
  • Loading branch information...
commit ab177d8cbe3ed208334ce9f550aa7afff65ba334 1 parent e562dde
David Heinemeier Hansson dhh authored
8 activerecord/test/cases/associations/has_many_associations_test.rb
View
@@ -785,10 +785,10 @@ def test_delete_all
companies(:first_firm).clients_of_firm.create("name" => "Another Client")
clients = companies(:first_firm).clients_of_firm.to_a
assert_equal 2, clients.count
- deleted = companies(:first_firm).clients_of_firm.delete_all
- assert_equal clients.sort_by(&:id), deleted.sort_by(&:id)
- assert_equal 0, companies(:first_firm).clients_of_firm.size
- assert_equal 0, companies(:first_firm).clients_of_firm(true).size
+
+ assert_difference "Client.count", -(clients.count) do
+ companies(:first_firm).clients_of_firm.delete_all
+ end
end
def test_delete_all_with_not_yet_loaded_association_collection
Please sign in to comment.
Something went wrong with that request. Please try again.