Skip to content
This repository
Browse code

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
@@ -785,10 +785,10 @@ def test_delete_all
785 785 companies(:first_firm).clients_of_firm.create("name" => "Another Client")
786 786 clients = companies(:first_firm).clients_of_firm.to_a
787 787 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
792 792 end
793 793
794 794 def test_delete_all_with_not_yet_loaded_association_collection

0 comments on commit ab177d8

Please sign in to comment.
Something went wrong with that request. Please try again.