From 7f32ef70f5e2acf6a8e7e3430f8661d6c04707c3 Mon Sep 17 00:00:00 2001 From: Ernesto Tagwerker Date: Mon, 24 Oct 2022 20:52:18 -0400 Subject: [PATCH] Improve `test_destroy_linked_models` by adding two assertions This change makes sure that a test scenario has reasonable assertions. --- .../test/cases/associations/belongs_to_associations_test.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb index 9b0d700bed..683854926e 100644 --- a/activerecord/test/cases/associations/belongs_to_associations_test.rb +++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb @@ -1660,5 +1660,8 @@ def test_destroy_linked_models author = Author.create! name: "Author", author_address_id: address.id author.destroy! + + assert_not AuthorAddress.exists?(address.id) + assert_not Author.exists?(author.id) end end