From 6ef390f2017adb63e62c8a3c4ac24b3f8e6aad99 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Wed, 23 Jul 2025 17:26:01 -0500 Subject: [PATCH] Test the destroy action --- .../notifications/readings_controller_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/controllers/notifications/readings_controller_test.rb b/test/controllers/notifications/readings_controller_test.rb index 75a8a4875..cdbca89ce 100644 --- a/test/controllers/notifications/readings_controller_test.rb +++ b/test/controllers/notifications/readings_controller_test.rb @@ -12,6 +12,16 @@ class Notifications::ReadingsControllerTest < ActionDispatch::IntegrationTest end end + test "destroy" do + notification = notifications(:logo_published_kevin) + notification.read # Mark as read first + + assert_changes -> { notification.reload.read? }, from: true, to: false do + delete read_notification_path(notification, format: :turbo_stream) + assert_response :success + end + end + test "create all" do assert_changes -> { notifications(:logo_published_kevin).reload.read? }, from: false, to: true do assert_changes -> { notifications(:layout_commented_kevin).reload.read? }, from: false, to: true do