DEV: Apply syntax_tree formatting to plugins/*

This commit is contained in:
David Taylor
2023-01-07 11:11:37 +00:00
parent 93e2dad656
commit 055310cea4
110 changed files with 3712 additions and 3158 deletions
@@ -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