test: add regression test for #316
authorWilliam Pitcock <nenolod@dereferenced.org>
Thu, 11 Oct 2018 10:35:32 +0000 (10:35 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Thu, 11 Oct 2018 10:35:32 +0000 (10:35 +0000)
test/user_test.exs

index 4b0f0739ed682f0f7470d61c993cfa34ba53eed4..248c26a3ddc9abc171c923f8722dbd9547434df1 100644 (file)
@@ -55,6 +55,15 @@ defmodule Pleroma.UserTest do
     {:error, _} = User.follow(blockee, blocker)
   end
 
+  test "local users do not automatically follow local locked accounts" do
+    follower = insert(:user, info: %{"locked" => true})
+    followed = insert(:user, info: %{"locked" => true})
+
+    {:ok, follower} = User.maybe_direct_follow(follower, followed)
+
+    refute User.following?(follower, followed)
+  end
+
   # This is a somewhat useless test.
   # test "following a remote user will ensure a websub subscription is present" do
   #   user = insert(:user)