Skip to content

A platform for community discussion. Free, open, simple.

DEV: Reinstate Chat::MessageCreator skipped thread specs (#21718)

Martin Brennan8076a84ff02b
diff --git a/plugins/chat/spec/components/chat/message_creator_spec.rb b/plugins/chat/spec/components/chat/message_creator_spec.rb
index 9eecc3e53b4..4ce81e0a837 100644
--- a/plugins/chat/spec/components/chat/message_creator_spec.rb
+++ b/plugins/chat/spec/components/chat/message_creator_spec.rb
@@ -726,7 +726,13 @@ describe Chat::MessageCreator do
end
it "creates a thread and updates all the messages in the chain" do
- skip "TODO: a recent spec regression"
+ # This must be done since the fabricator uses Chat::MessageCreator
+ # under the hood and it creates the thread already.
+ old_message_1.update!(thread_id: nil)
+ old_message_2.update!(thread_id: nil)
+ old_message_3.update!(thread_id: nil)
+ reply_message.update!(thread_id: nil)
+
thread_count = Chat::Thread.count
message =
described_class.create(
@@ -851,11 +857,11 @@ describe Chat::MessageCreator do
before do
old_message_1.update!(thread: old_thread)
+ old_message_2.update!(thread: old_thread)
old_message_3.update!(thread: incorrect_thread)
end
it "does not change any messages in the chain, assumes they have the correct thread ID" do
- skip "TODO: a recent spec regression"
thread_count = Chat::Thread.count
message =
described_class.create(