Add User.get_follow_state/2

This commit is contained in:
Egor Kislitsyn 2020-02-07 16:17:34 +04:00
commit bc2e98b200
No known key found for this signature in database
GPG key ID: 1B49CB15B71E7805
3 changed files with 27 additions and 28 deletions

View file

@ -544,11 +544,9 @@ defmodule Pleroma.Web.CommonAPITest do
assert {:ok, follower, followed, %{id: activity_id, data: %{"state" => "pending"}}} =
CommonAPI.follow(follower, followed)
assert %{state: "pending"} = Pleroma.FollowingRelationship.get(follower, followed)
assert User.get_follow_state(follower, followed) == "pending"
assert {:ok, follower} = CommonAPI.unfollow(follower, followed)
assert Pleroma.FollowingRelationship.get(follower, followed) == nil
assert User.get_follow_state(follower, followed) == nil
assert %{id: ^activity_id, data: %{"state" => "cancelled"}} =
Pleroma.Web.ActivityPub.Utils.fetch_latest_follow(follower, followed)
@ -568,11 +566,9 @@ defmodule Pleroma.Web.CommonAPITest do
assert {:ok, follower, followed, %{id: activity_id, data: %{"state" => "pending"}}} =
CommonAPI.follow(follower, followed)
assert %{state: "pending"} = Pleroma.FollowingRelationship.get(follower, followed)
assert User.get_follow_state(follower, followed) == "pending"
assert {:ok, follower} = CommonAPI.unfollow(follower, followed)
assert Pleroma.FollowingRelationship.get(follower, followed) == nil
assert User.get_follow_state(follower, followed) == nil
assert %{id: ^activity_id, data: %{"state" => "cancelled"}} =
Pleroma.Web.ActivityPub.Utils.fetch_latest_follow(follower, followed)