diff options
author | rinpatch <rinpatch@sdf.org> | 2020-04-16 21:28:52 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-04-16 21:28:52 +0300 |
commit | 942d7467ca28c898f914539ae85ea3044c36ebbc (patch) | |
tree | 03d909dfcf5974838919076c6ae994515b0c1f84 /test/web/mastodon_api/controllers/notification_controller_test.exs | |
parent | e89078ac2a27bb0a833c982dbb5eef63ddea3cc0 (diff) | |
parent | 252528a4b9ca3a5d92f1676c44989ad7d8777de1 (diff) | |
download | pleroma-942d7467ca28c898f914539ae85ea3044c36ebbc.tar.gz pleroma-942d7467ca28c898f914539ae85ea3044c36ebbc.zip |
Merge branch 'develop' into features/remove-user-source_data
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) |