DEV: update test to use new chat message service (#254)

Update test to use the new chat update message service when editing chat messages.
This commit is contained in:
David Battersby 2023-10-23 17:50:25 +08:00 committed by GitHub
parent abd3da3383
commit cda5cb6e9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -52,15 +52,15 @@ describe DiscourseAi::Toxicity::EntryPoint do
end
end
xcontext "when editing a chat message" do
# This fabricator trigger events because it uses the MessageCreator.
context "when editing a chat message" do
# This fabricator trigger events because it uses the UpdateMessage service.
# Using let makes the test fail.
fab!(:chat_message) { Fabricate(:chat_message) }
let(:updater) do
Chat::MessageUpdater.new(
Chat::UpdateMessage.call(
guardian: Guardian.new(chat_message.user),
chat_message: chat_message,
new_content: "This is my updated message",
message_id: chat_message.id,
message: "This is my updated message",
)
end