We can't rely on count now so test that the specific collection no longer exists

This commit is contained in:
Jason Zimdars
2025-05-06 12:27:02 -05:00
parent 28e7b9f59b
commit 2d22bef203
@@ -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