From 9ded80d448bf0d14ca080e01aab19e04c562c719 Mon Sep 17 00:00:00 2001 From: Rosa Gutierrez Date: Tue, 24 Feb 2026 12:26:12 +0100 Subject: [PATCH] Add test for notifying new mentionees when editing a comment Co-Authored-By: Claude Opus 4.6 --- test/models/concerns/mentions_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/models/concerns/mentions_test.rb b/test/models/concerns/mentions_test.rb index fca379bf1..c26d37632 100644 --- a/test/models/concerns/mentions_test.rb +++ b/test/models/concerns/mentions_test.rb @@ -81,6 +81,18 @@ class MentionsTest < ActiveSupport::TestCase end end + test "notify new mentionees when editing a comment to add a mention" do + card = boards(:writebook).cards.create title: "Fresh card", description: "Some content", status: :published + + perform_enqueued_jobs do + comment = card.comments.create!(body: "Initial thought") + + assert_difference -> { users(:kevin).notifications.count }, +1 do + comment.update!(body: "Actually, #{mention_html_for(users(:kevin))}, what do you think?") + end + end + end + test "mentionees are added as watchers of the card" do perform_enqueued_jobs only: Mention::CreateJob do card = boards(:writebook).cards.create title: "Cleanup", description: "Did you finish up with the cleanup #{mention_html_for(users(:kevin))}?"