summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2021-11-26 21:42:28 -0600
committerAlex Gleason <alex@alexgleason.me>2021-11-26 21:46:08 -0600
commite5a7547fbe1c8eccafabc458e1cbec1461bcbc9c (patch)
tree2b0511fe25b0868cf44b137f8d680a2af6bc1b29 /test
parent437c1a5a52d6fdde3dd8ce62b3eb4c8d8507b05e (diff)
v2 Suggestions: also filter out users you follow
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/mastodon_api/controllers/suggestion_controller_test.exs15
1 files changed, 14 insertions, 1 deletions
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