FIX: Make the 'Keep Message Deleted' reviewable option work (#32345)

When a flagged chat message has already been deleted, we offer an option
in the review queue to agree with the flag and keep the message deleted.
However, this option is currently broken due to a missing implementation
for the option.

Internal topic: t/152203.
This commit is contained in:
Osama Sayegh
2025-04-17 07:35:08 +03:00
committed by GitHub
parent a69a304f11
commit 530f2f13af
2 changed files with 11 additions and 0 deletions

View File

@ -19,6 +19,13 @@ RSpec.describe Chat::ReviewableMessage, type: :model do
expect(chat_message.reload.deleted_at).not_to be_present
end
it "agree_and_keep_deleted agrees with the flag and keeps the message deleted" do
chat_message.trash!(user)
reviewable.perform(moderator, :agree_and_keep_deleted)
expect(reviewable).to be_approved
expect(chat_message.reload.deleted_at).to be_present
end
it "agree_and_delete agrees with the flag and deletes the message" do
chat_message_id = chat_message.id
reviewable.perform(moderator, :agree_and_delete)