discourse/plugins/chat/spec
Loïc Guitaut e1ae32103d DEV: Refactor chat specs related to message creation
This is extracted from #22390.

This patch aims to ease the transition to the new message creation
service. (in progress in #22390) Indeed, the new service patch is
breaking some specs from `discourse-ai` and `discourse-templates`
because these plugins are using either `Chat::MessageCreator` or the
`chat_message` fabricator.

This patch addresses theses issues by normalizing how we create a chat
message in specs. To do so, the preferred way is to use
`Fabricate(:chat_message)` with a new `:use_service` option allowing to
call the service under the hood. While this patch will obviously call
`Chat::MessageCreator`, the new service patch will now be able to simply
change the call to `Chat::CreateMessage` without breaking any specs from
other plugins.

Another thing this patch does is to not create chat messages using the
service for specs that aren’t system ones, thus speeding the execution
time a bit in the process.
2023-08-31 11:21:23 +02:00
..
components/chat DEV: Refactor chat specs related to message creation 2023-08-31 11:21:23 +02:00
fabricators DEV: Refactor chat specs related to message creation 2023-08-31 11:21:23 +02:00
integration DEV: Remove experimental site setting for chat threads (#22720) 2023-07-26 12:46:23 +02:00
jobs DEV: Refactor chat specs related to message creation 2023-08-31 11:21:23 +02:00
lib DEV: Refactor chat specs related to message creation 2023-08-31 11:21:23 +02:00
mailers DEV: Refactor chat specs related to message creation 2023-08-31 11:21:23 +02:00
models FEATURE: implements user based sidebar mode (#23078) 2023-08-18 20:33:07 +02:00
queries/chat FEATURE: thread pagination (#22624) 2023-07-27 09:57:03 +02:00
requests DEV: Refactor chat specs related to message creation 2023-08-31 11:21:23 +02:00
serializer FEATURE: implements user based sidebar mode (#23078) 2023-08-18 20:33:07 +02:00
services DEV: Refactor chat specs related to message creation 2023-08-31 11:21:23 +02:00
support FEATURE: Show unread in sidebar for unread channel threads (#22342) 2023-07-17 13:00:49 +10:00
system DEV: Refactor chat specs related to message creation 2023-08-31 11:21:23 +02:00
validators DEV: properly namespace chat (#20690) 2023-03-17 14:24:38 +01:00
plugin_helper.rb DEV: Refactor chat specs related to message creation 2023-08-31 11:21:23 +02:00
plugin_spec.rb DEV: Refactor chat specs related to message creation 2023-08-31 11:21:23 +02:00