diff --git a/spec/lib/modules/toxicity/entry_point_spec.rb b/spec/lib/modules/toxicity/entry_point_spec.rb index b1cdfc33..d656a7a3 100644 --- a/spec/lib/modules/toxicity/entry_point_spec.rb +++ b/spec/lib/modules/toxicity/entry_point_spec.rb @@ -38,16 +38,17 @@ describe DiscourseAi::Toxicity::EntryPoint do context "when creating a chat message" do fab!(:public_chat_channel) { Fabricate(:chat_channel) } - let(:creator) do - Chat::MessageCreator.new( - chat_channel: public_chat_channel, - user: user, - content: "This is my new test", - ) - end it "queues a job when creating a chat message" do - expect { creator.create }.to change(Jobs::ToxicityClassifyChatMessage.jobs, :size).by(1) + expect { + Fabricate( + :chat_message, + chat_channel: public_chat_channel, + user: user, + message: "This is my new test", + use_service: true, + ) + }.to change(Jobs::ToxicityClassifyChatMessage.jobs, :size).by(1) end end