Skip to content

Commit 84b24c9

Browse files
We should assert for current car's funky bulb count, not overall bulb count
- Though has_many_associations test file does not use bulbs fixtures, other files use it and if those files are run before has_many_associations_test file then there can be some bulbs records present in the database which are not associated with the current car being tested. So the assertion `Car.count` was non-zero sometimes.
1 parent b7a5bd6 commit 84b24c9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

activerecord/test/cases/associations/has_many_associations_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,11 @@ def test_create_from_association_with_nil_values_should_work
242242
end
243243

244244
def test_do_not_call_callbacks_for_delete_all
245+
<<<<<<< 13c8ec5a554b33083dee3af652b89b4727b90b6a
245246
car = Car.create(name: "honda")
247+
=======
248+
car = Car.create(name: 'honda')
249+
>>>>>>> We should assert for current car's funky bulb count, not overall bulb count
246250
car.funky_bulbs.create!
247251
assert_equal 1, car.funky_bulbs.count
248252
assert_nothing_raised { car.reload.funky_bulbs.delete_all }

0 commit comments

Comments
 (0)