summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/notification_controller_test.exs
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-04-13 13:05:40 +0000
committerrinpatch <rinpatch@sdf.org>2020-04-13 13:05:40 +0000
commitef37774403ff5af69a637875240eec205b6f55a5 (patch)
tree22239f2cc64f27e5db487e0fea919e13137b3e57 /test/web/mastodon_api/controllers/notification_controller_test.exs
parent7ee35eb9a6a55ef610eb02a04a33f67e5921cff3 (diff)
parent5c76afb06c731557b537f928296e0b5c259f8d5e (diff)
downloadpleroma-ef37774403ff5af69a637875240eec205b6f55a5.tar.gz
pleroma-ef37774403ff5af69a637875240eec205b6f55a5.zip
Merge branch 'output-of-relationships-in-statuses' into 'develop'
Ability to control the output of AccountView.pleroma.relationship in statuses / notifications See merge request pleroma/pleroma!2342
Diffstat (limited to 'test/web/mastodon_api/controllers/notification_controller_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/notification_controller_test.exs20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/web/mastodon_api/controllers/notification_controller_test.exs b/test/web/mastodon_api/controllers/notification_controller_test.exs
index 1557937d8..8c815b415 100644
--- a/test/web/mastodon_api/controllers/notification_controller_test.exs
+++ b/test/web/mastodon_api/controllers/notification_controller_test.exs
@@ -12,6 +12,26 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
import Pleroma.Factory
+ test "does NOT render account/pleroma/relationship if this is disabled by default" do
+ clear_config([:extensions, :output_relationships_in_statuses_by_default], false)
+
+ %{user: user, conn: conn} = oauth_access(["read:notifications"])
+ other_user = insert(:user)
+
+ {:ok, activity} = CommonAPI.post(other_user, %{"status" => "hi @#{user.nickname}"})
+ {:ok, [_notification]} = Notification.create_notifications(activity)
+
+ response =
+ conn
+ |> assign(:user, user)
+ |> get("/api/v1/notifications")
+ |> json_response(200)
+
+ assert Enum.all?(response, fn n ->
+ get_in(n, ["account", "pleroma", "relationship"]) == %{}
+ end)
+ end
+
test "list of notifications" do
%{user: user, conn: conn} = oauth_access(["read:notifications"])
other_user = insert(:user)