From 2d22bef2035655f8cbfbfa53ec7ef9ed7533a6a8 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Tue, 6 May 2025 12:27:02 -0500 Subject: [PATCH] We can't rely on count now so test that the specific collection no longer exists --- test/controllers/collections_controller_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/controllers/collections_controller_test.rb b/test/controllers/collections_controller_test.rb index f816332b8..9d3275078 100644 --- a/test/controllers/collections_controller_test.rb +++ b/test/controllers/collections_controller_test.rb @@ -55,9 +55,9 @@ class CollectionsControllerTest < ActionDispatch::IntegrationTest end test "destroy" do - assert_difference -> { Collection.count }, -1 do - delete collection_path(collections(:writebook)) - assert_redirected_to root_path - end + collection = collections(:writebook) + delete collection_path(collection) + assert_redirected_to root_path + assert_raises(ActiveRecord::RecordNotFound) { collection.reload } end end