From 3842ab2714ef04dfe564eac9b6732498dff8561f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 25 Jul 2024 14:23:03 +0200 Subject: [PATCH] update test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../20200806175913_rename_instance_chat.exs | 2 - .../transmogrifier/question_handling_test.exs | 2 +- test/pleroma/webhook_test.ex | 57 ------------------- 3 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 test/pleroma/webhook_test.ex diff --git a/priv/repo/migrations/20200806175913_rename_instance_chat.exs b/priv/repo/migrations/20200806175913_rename_instance_chat.exs index 44d3530996..a89c15057e 100644 --- a/priv/repo/migrations/20200806175913_rename_instance_chat.exs +++ b/priv/repo/migrations/20200806175913_rename_instance_chat.exs @@ -5,8 +5,6 @@ defmodule Pleroma.Repo.Migrations.RenameInstanceChat do use Ecto.Migration - alias Pleroma.ConfigDB - def up, do: :noop def down, do: :noop end diff --git a/test/pleroma/web/activity_pub/transmogrifier/question_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/question_handling_test.exs index 100210826a..ca921d77c3 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/question_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/question_handling_test.exs @@ -182,7 +182,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.QuestionHandlingTest do }) object = Object.normalize(activity, fetch: false) - {:ok, _, _} = CommonAPI.vote(other_user, object, [1]) + {:ok, _, _} = CommonAPI.vote(object, other_user, [1]) {:ok, modified} = Transmogrifier.prepare_outgoing(activity.data) diff --git a/test/pleroma/webhook_test.ex b/test/pleroma/webhook_test.ex deleted file mode 100644 index 21763f1e00..0000000000 --- a/test/pleroma/webhook_test.ex +++ /dev/null @@ -1,57 +0,0 @@ -# Pleroma: A lightweight social networking server -# Copyright © 2017-2022 Pleroma Authors -# SPDX-License-Identifier: AGPL-3.0-only - -defmodule Pleroma.WebhookTest do - use Pleroma.DataCase, async: true - - alias Pleroma.Repo - alias Pleroma.Webhook - - test "creating a webhook" do - %{id: id} = Webhook.create(%{url: "https://example.com/webhook", events: [:"report.created"]}) - - assert %{url: "https://example.com/webhook"} = Webhook.get(id) - end - - test "editing a webhook" do - %{id: id} = - webhook = Webhook.create(%{url: "https://example.com/webhook", events: [:"report.created"]}) - - Webhook.update(webhook, %{events: [:"account.created"]}) - - assert %{events: [:"account.created"]} = Webhook.get(id) - end - - test "filter webhooks by type" do - %{id: id1} = - Webhook.create(%{url: "https://example.com/webhook1", events: [:"report.created"]}) - - %{id: id2} = - Webhook.create(%{ - url: "https://example.com/webhook2", - events: [:"account.created", :"report.created"] - }) - - Webhook.create(%{url: "https://example.com/webhook3", events: [:"account.created"]}) - - assert [%{id: ^id1}, %{id: ^id2}] = Webhook.get_by_type(:"report.created") - end - - test "change webhook state" do - %{id: id, enabled: true} = - webhook = Webhook.create(%{url: "https://example.com/webhook", events: [:"report.created"]}) - - Webhook.set_enabled(webhook, false) - assert %{enabled: false} = Webhook.get(id) - end - - test "rotate webhook secrets" do - %{id: id, secret: secret} = - webhook = Webhook.create(%{url: "https://example.com/webhook", events: [:"report.created"]}) - - Webhook.rotate_secret(webhook) - %{secret: new_secret} = Webhook.get(id) - assert secret != new_secret - end -end