diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2020-04-20 20:37:56 +0400 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2020-04-20 20:37:56 +0400 |
commit | 364eecc49f137ae3c7798ad240983591e27b134c (patch) | |
tree | 7ed228221db9794b0aae59fa0e548623c0aa12ae /test/web/mastodon_api/controllers/notification_controller_test.exs | |
parent | dc8fa04192cc133749e762b78ec043e0902d046d (diff) | |
parent | 28165dad3ac02a6d3ba4b0cda51992a1831515dd (diff) | |
download | pleroma-364eecc49f137ae3c7798ad240983591e27b134c.tar.gz pleroma-364eecc49f137ae3c7798ad240983591e27b134c.zip |
Merge branch 'develop' into global-status-expiration
Diffstat (limited to 'test/web/mastodon_api/controllers/notification_controller_test.exs')
-rw-r--r-- | test/web/mastodon_api/controllers/notification_controller_test.exs | 20 |
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) |