From: lain Date: Wed, 27 Feb 2019 13:51:07 +0000 (+0100) Subject: Add follow request test. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=8d8cb08f94490299bfc7fe97381a34e4a7a095a9;p=akkoma Add follow request test. --- diff --git a/test/user_test.exs b/test/user_test.exs index 0b1c39ecf..cbe4693fc 100644 --- a/test/user_test.exs +++ b/test/user_test.exs @@ -50,6 +50,20 @@ defmodule Pleroma.UserTest do assert expected_followers_collection == User.ap_followers(user) end + test "returns all pending follow requests" do + unlocked = insert(:user) + locked = insert(:user, %{info: %{locked: true}}) + follower = insert(:user) + + Pleroma.Web.TwitterAPI.TwitterAPI.follow(follower, %{"user_id" => unlocked.id}) + Pleroma.Web.TwitterAPI.TwitterAPI.follow(follower, %{"user_id" => locked.id}) + + assert {:ok, []} = User.get_follow_requests(unlocked) + assert {:ok, [activity]} = User.get_follow_requests(locked) + + assert activity + end + test "follow_all follows mutliple users" do user = insert(:user) followed_zero = insert(:user)