mirror of
https://github.com/discourse/discourse.git
synced 2026-08-17 16:35:03 -05:00
DEV: Apply syntax_tree formatting to plugins/*
This commit is contained in:
@@ -56,23 +56,23 @@ describe Jobs::ChatChannelDelete do
|
||||
expect { described_class.new.execute(chat_channel_id: chat_channel.id) }.to change {
|
||||
IncomingChatWebhook.where(chat_channel_id: chat_channel.id).count
|
||||
}.by(-1).and change {
|
||||
ChatWebhookEvent.where(incoming_chat_webhook_id: @incoming_chat_webhook_id).count
|
||||
}.by(-1).and change { ChatDraft.where(chat_channel: chat_channel).count }.by(
|
||||
ChatWebhookEvent.where(incoming_chat_webhook_id: @incoming_chat_webhook_id).count
|
||||
}.by(-1).and change { ChatDraft.where(chat_channel: chat_channel).count }.by(
|
||||
-1,
|
||||
).and change {
|
||||
UserChatChannelMembership.where(chat_channel: chat_channel).count
|
||||
}.by(-3).and change {
|
||||
ChatMessageRevision.where(chat_message_id: @message_ids).count
|
||||
}.by(-1).and change {
|
||||
ChatMention.where(chat_message_id: @message_ids).count
|
||||
}.by(-1).and change {
|
||||
ChatUpload.where(chat_message_id: @message_ids).count
|
||||
}.by(-10).and change {
|
||||
ChatMessage.where(id: @message_ids).count
|
||||
}.by(-20).and change {
|
||||
ChatMessageReaction.where(
|
||||
chat_message_id: @message_ids,
|
||||
).count
|
||||
}.by(-10)
|
||||
ChatMessageRevision.where(chat_message_id: @message_ids).count
|
||||
}.by(-1).and change {
|
||||
ChatMention.where(chat_message_id: @message_ids).count
|
||||
}.by(-1).and change {
|
||||
ChatUpload.where(chat_message_id: @message_ids).count
|
||||
}.by(-10).and change {
|
||||
ChatMessage.where(id: @message_ids).count
|
||||
}.by(-20).and change {
|
||||
ChatMessageReaction.where(
|
||||
chat_message_id: @message_ids,
|
||||
).count
|
||||
}.by(-10)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -21,7 +21,7 @@ RSpec.describe Jobs::SendMessageNotifications do
|
||||
subject.execute(
|
||||
chat_message_id: chat_message.id,
|
||||
reason: "invalid",
|
||||
timestamp: 1.minute.ago
|
||||
timestamp: 1.minute.ago,
|
||||
)
|
||||
end
|
||||
|
||||
@@ -29,32 +29,21 @@ RSpec.describe Jobs::SendMessageNotifications do
|
||||
Chat::ChatNotifier.any_instance.expects(:notify_new).never
|
||||
Chat::ChatNotifier.any_instance.expects(:notify_edit).never
|
||||
|
||||
subject.execute(
|
||||
chat_message_id: chat_message.id,
|
||||
reason: "new"
|
||||
)
|
||||
subject.execute(chat_message_id: chat_message.id, reason: "new")
|
||||
end
|
||||
|
||||
it "calls notify_new when the reason is 'new'" do
|
||||
Chat::ChatNotifier.any_instance.expects(:notify_new).once
|
||||
Chat::ChatNotifier.any_instance.expects(:notify_edit).never
|
||||
|
||||
subject.execute(
|
||||
chat_message_id: chat_message.id,
|
||||
reason: "new",
|
||||
timestamp: 1.minute.ago
|
||||
)
|
||||
subject.execute(chat_message_id: chat_message.id, reason: "new", timestamp: 1.minute.ago)
|
||||
end
|
||||
|
||||
it "calls notify_edit when the reason is 'edit'" do
|
||||
Chat::ChatNotifier.any_instance.expects(:notify_new).never
|
||||
Chat::ChatNotifier.any_instance.expects(:notify_edit).once
|
||||
|
||||
subject.execute(
|
||||
chat_message_id: chat_message.id,
|
||||
reason: "edit",
|
||||
timestamp: 1.minute.ago
|
||||
)
|
||||
subject.execute(chat_message_id: chat_message.id, reason: "edit", timestamp: 1.minute.ago)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user