summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/notification_test.exs2
-rw-r--r--test/pleroma/web/activity_pub/activity_pub_test.exs4
-rw-r--r--test/pleroma/web/common_api_test.exs14
-rw-r--r--test/pleroma/web/mastodon_api/controllers/status_controller_test.exs4
-rw-r--r--test/pleroma/web/mastodon_api/views/status_view_test.exs2
-rw-r--r--test/pleroma/web/streamer_test.exs4
6 files changed, 15 insertions, 15 deletions
diff --git a/test/pleroma/notification_test.exs b/test/pleroma/notification_test.exs
index c7ed18bba..8b3d01270 100644
--- a/test/pleroma/notification_test.exs
+++ b/test/pleroma/notification_test.exs
@@ -693,7 +693,7 @@ defmodule Pleroma.NotificationTest do
{:ok, activity} = CommonAPI.post(user, %{status: "hey @#{other_user.nickname}!"})
- {:ok, _} = CommonAPI.add_mute(other_user, activity)
+ {:ok, _} = CommonAPI.add_mute(activity, other_user)
{:ok, same_context_activity} =
CommonAPI.post(user, %{
diff --git a/test/pleroma/web/activity_pub/activity_pub_test.exs b/test/pleroma/web/activity_pub/activity_pub_test.exs
index 2fc1f3520..e6fcf9fcc 100644
--- a/test/pleroma/web/activity_pub/activity_pub_test.exs
+++ b/test/pleroma/web/activity_pub/activity_pub_test.exs
@@ -1171,7 +1171,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
note_two = insert(:note, data: %{"context" => "suya.."})
activity_two = insert(:note_activity, note: note_two)
- {:ok, _activity_two} = CommonAPI.add_mute(user, activity_two)
+ {:ok, _activity_two} = CommonAPI.add_mute(activity_two, user)
assert [_activity_one] = ActivityPub.fetch_activities([], %{muting_user: user})
end
@@ -1182,7 +1182,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
note_two = insert(:note, data: %{"context" => "suya.."})
activity_two = insert(:note_activity, note: note_two)
- {:ok, _activity_two} = CommonAPI.add_mute(user, activity_two)
+ {:ok, _activity_two} = CommonAPI.add_mute(activity_two, user)
assert [_activity_two, _activity_one] =
ActivityPub.fetch_activities([], %{muting_user: user, with_muted: true})
diff --git a/test/pleroma/web/common_api_test.exs b/test/pleroma/web/common_api_test.exs
index 0ad296e42..7c92084bc 100644
--- a/test/pleroma/web/common_api_test.exs
+++ b/test/pleroma/web/common_api_test.exs
@@ -1172,7 +1172,7 @@ defmodule Pleroma.Web.CommonAPITest do
n.type == "mention" && n.activity_id == reply_activity.id
end)
- {:ok, _} = CommonAPI.add_mute(author, activity)
+ {:ok, _} = CommonAPI.add_mute(activity, author)
assert CommonAPI.thread_muted?(author, activity)
assert Repo.aggregate(
@@ -1197,12 +1197,12 @@ defmodule Pleroma.Web.CommonAPITest do
end
test "add mute", %{user: user, activity: activity} do
- {:ok, _} = CommonAPI.add_mute(user, activity)
+ {:ok, _} = CommonAPI.add_mute(activity, user)
assert CommonAPI.thread_muted?(user, activity)
end
test "add expiring mute", %{user: user, activity: activity} do
- {:ok, _} = CommonAPI.add_mute(user, activity, %{expires_in: 60})
+ {:ok, _} = CommonAPI.add_mute(activity, user, %{expires_in: 60})
assert CommonAPI.thread_muted?(user, activity)
worker = Pleroma.Workers.MuteExpireWorker
@@ -1218,20 +1218,20 @@ defmodule Pleroma.Web.CommonAPITest do
end
test "remove mute", %{user: user, activity: activity} do
- CommonAPI.add_mute(user, activity)
+ CommonAPI.add_mute(activity, user)
{:ok, _} = CommonAPI.remove_mute(activity, user)
refute CommonAPI.thread_muted?(user, activity)
end
test "remove mute by ids", %{user: user, activity: activity} do
- CommonAPI.add_mute(user, activity)
+ CommonAPI.add_mute(activity, user)
{:ok, _} = CommonAPI.remove_mute(activity.id, user.id)
refute CommonAPI.thread_muted?(user, activity)
end
test "check that mutes can't be duplicate", %{user: user, activity: activity} do
- CommonAPI.add_mute(user, activity)
- {:error, _} = CommonAPI.add_mute(user, activity)
+ CommonAPI.add_mute(activity, user)
+ {:error, _} = CommonAPI.add_mute(activity, user)
end
end
diff --git a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
index eb43f964a..904bf1471 100644
--- a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
+++ b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
@@ -1771,7 +1771,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
end
test "cannot mute already muted conversation", %{conn: conn, user: user, activity: activity} do
- {:ok, _} = CommonAPI.add_mute(user, activity)
+ {:ok, _} = CommonAPI.add_mute(activity, user)
conn =
conn
@@ -1784,7 +1784,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
end
test "unmute conversation", %{conn: conn, user: user, activity: activity} do
- {:ok, _} = CommonAPI.add_mute(user, activity)
+ {:ok, _} = CommonAPI.add_mute(activity, user)
id_str = to_string(activity.id)
diff --git a/test/pleroma/web/mastodon_api/views/status_view_test.exs b/test/pleroma/web/mastodon_api/views/status_view_test.exs
index cfcb8cfb2..88a3940c3 100644
--- a/test/pleroma/web/mastodon_api/views/status_view_test.exs
+++ b/test/pleroma/web/mastodon_api/views/status_view_test.exs
@@ -388,7 +388,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
assert status.pleroma.thread_muted == false
- {:ok, activity} = CommonAPI.add_mute(user, activity)
+ {:ok, activity} = CommonAPI.add_mute(activity, user)
status = StatusView.render("show.json", %{activity: activity, for: user})
diff --git a/test/pleroma/web/streamer_test.exs b/test/pleroma/web/streamer_test.exs
index e53c6adc4..edeec187c 100644
--- a/test/pleroma/web/streamer_test.exs
+++ b/test/pleroma/web/streamer_test.exs
@@ -430,7 +430,7 @@ defmodule Pleroma.Web.StreamerTest do
user2 = insert(:user)
{:ok, activity} = CommonAPI.post(user, %{status: "super hot take"})
- {:ok, _} = CommonAPI.add_mute(user, activity)
+ {:ok, _} = CommonAPI.add_mute(activity, user)
Streamer.get_topic_and_add_socket("user:notification", user, oauth_token)
@@ -878,7 +878,7 @@ defmodule Pleroma.Web.StreamerTest do
{:ok, user2, user, _activity} = CommonAPI.follow(user2, user)
{:ok, activity} = CommonAPI.post(user, %{status: "super hot take"})
- {:ok, _} = CommonAPI.add_mute(user2, activity)
+ {:ok, _} = CommonAPI.add_mute(activity, user2)
assert_receive {:render_with_user, _, _, ^activity, _}
assert Streamer.filtered_by_user?(user2, activity)