FIX: webhook should touch channel’s last_message_sent_at (#19342)

This commit is contained in:
Joffrey JAFFEUX
2022-12-06 19:33:39 +01:00
committed by GitHub
parent 9c8043a4d2
commit 179d15d90e
3 changed files with 13 additions and 1 deletions

View File

@ -112,6 +112,18 @@ describe Chat::ChatMessageCreator do
}.to change { ChatMessage.count }.by(1)
end
it "updates the channel’s last message date" do
previous_last_message_sent_at = public_chat_channel.last_message_sent_at
Chat::ChatMessageCreator.create(
chat_channel: public_chat_channel,
user: user1,
content: "this is a message",
)
expect(previous_last_message_sent_at).to be < public_chat_channel.reload.last_message_sent_at
end
it "sets the last_editor_id to the user who created the message" do
message =
Chat::ChatMessageCreator.create(