Add test to ensure the blocked cease to have follow relationship to the blocker

https://git.pleroma.social/pleroma/pleroma/-/issues/2766
This commit is contained in:
Tusooa Zhu 2021-12-17 14:42:45 -05:00
parent 3d41ccc47b
commit bfd870380c
No known key found for this signature in database
GPG Key ID: 7B467EDE43A08224
1 changed files with 10 additions and 0 deletions

View File

@ -88,6 +88,16 @@ defmodule Pleroma.Web.ActivityPub.SideEffectsTest do
assert User.blocks?(user, blocked)
end
test "it updates following relationship", %{user: user, blocked: blocked, block: block} do
{:ok, _, _} = SideEffects.handle(block)
refute Pleroma.FollowingRelationship.get(user, blocked)
assert User.get_follow_state(user, blocked) == nil
assert User.get_follow_state(blocked, user) == nil
assert User.get_follow_state(user, blocked, nil) == nil
assert User.get_follow_state(blocked, user, nil) == nil
end
test "it blocks but does not unfollow if the relevant setting is set", %{
user: user,
blocked: blocked,