From cda5cb6e9c5c7b4d71d5c769b82a1c6949575b72 Mon Sep 17 00:00:00 2001 From: David Battersby Date: Mon, 23 Oct 2023 17:50:25 +0800 Subject: [PATCH] DEV: update test to use new chat message service (#254) Update test to use the new chat update message service when editing chat messages. --- spec/lib/modules/toxicity/entry_point_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/lib/modules/toxicity/entry_point_spec.rb b/spec/lib/modules/toxicity/entry_point_spec.rb index 0a90935a..8e66d56a 100644 --- a/spec/lib/modules/toxicity/entry_point_spec.rb +++ b/spec/lib/modules/toxicity/entry_point_spec.rb @@ -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