Merge branch 'outgoing_follow_requests' into 'develop'

Add /api/v1/pleroma/outgoing_follow_requests

See merge request pleroma/pleroma!4310
This commit is contained in:
nicole mikołajczyk 2025-11-28 16:36:40 +01:00
commit 367d5c65f6
7 changed files with 99 additions and 0 deletions

View file

@ -0,0 +1,27 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2024 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.PleromaAPI.FollowRequestControllerTest do
use Pleroma.Web.ConnCase, async: true
alias Pleroma.Web.CommonAPI
import Pleroma.Factory
test "/api/v1/pleroma/outgoing_follow_requests works" do
%{conn: conn, user: user} = oauth_access(["read:follows"])
other_user1 = insert(:user)
other_user2 = insert(:user, is_locked: true)
_other_user3 = insert(:user)
{:ok, _, _, _} = CommonAPI.follow(other_user1, user)
{:ok, _, _, _} = CommonAPI.follow(other_user2, user)
conn = get(conn, "/api/v1/pleroma/outgoing_follow_requests")
assert [relationship] = json_response_and_validate_schema(conn, 200)
assert to_string(other_user2.id) == relationship["id"]
end
end