DEV: do not fabricate a Notification when fabricating a ChatMention (#20450)

Initially, the chat_mention db table was created to support notifications. So when creating 
a `chat_mention` record we were always creating a related `notification` record. So did the
ChatMention fabricator. 

Now we want to use the chat_mention db table in other scenarios. So we started decoupling 
mentions from notification in 75b81b68.

This removes fabrication of Notifications from the ChatMention fabricator. We need to be able 
to fabricate a ChatMention without a Notification.
This commit is contained in:
Andrei Prigorshnev
2023-02-27 14:41:28 +04:00
committed by GitHub
parent e82b8c2b06
commit 69c7df2e56
5 changed files with 96 additions and 55 deletions

View File

@@ -465,7 +465,8 @@ describe ChatMessage do
it "destroys chat_mention" do
message_1 = Fabricate(:chat_message)
mention_1 = Fabricate(:chat_mention, chat_message: message_1)
notification = Fabricate(:notification)
mention_1 = Fabricate(:chat_mention, chat_message: message_1, notification: notification)
message_1.destroy!