X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Fmastodon_api%2Fcontrollers%2Fsuggestion_controller_test.exs;h=89273e67bd3251204ec0c8ee7af2067ec34064ea;hb=e4f2251e0f5744de66b9b3bee2a0086bc7ab2bb1;hp=8948a52de149c60d1ecb10ed5eb2c9133911ff55;hpb=437c1a5a52d6fdde3dd8ce62b3eb4c8d8507b05e;p=akkoma diff --git a/test/pleroma/web/mastodon_api/controllers/suggestion_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/suggestion_controller_test.exs index 8948a52de..89273e67b 100644 --- a/test/pleroma/web/mastodon_api/controllers/suggestion_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/suggestion_controller_test.exs @@ -5,6 +5,7 @@ defmodule Pleroma.Web.MastodonAPI.SuggestionControllerTest do use Pleroma.Web.ConnCase, async: true alias Pleroma.UserRelationship + alias Pleroma.Web.CommonAPI import Pleroma.Factory setup do: oauth_access(["read", "write"]) @@ -46,7 +47,19 @@ defmodule Pleroma.Web.MastodonAPI.SuggestionControllerTest do test "returns v2 suggestions excluding blocked accounts", %{conn: conn, user: blocker} do blocked = insert(:user, is_suggested: true) - {:ok, _} = Pleroma.Web.CommonAPI.block(blocker, blocked) + {:ok, _} = CommonAPI.block(blocker, blocked) + + res = + conn + |> get("/api/v2/suggestions") + |> json_response_and_validate_schema(200) + + assert [] = res + end + + test "returns v2 suggestions excluding followed accounts", %{conn: conn, user: follower} do + followed = insert(:user, is_suggested: true) + {:ok, _, _, _} = CommonAPI.follow(follower, followed) res = conn