Visibility: Make it more resilient.

This commit is contained in:
lain 2019-05-08 18:08:50 +02:00
commit a4598b5e8b
2 changed files with 15 additions and 4 deletions

View file

@ -95,4 +95,14 @@ defmodule Pleroma.Web.ActivityPub.VisibilityTest do
refute Visibility.visible_for_user?(private, unrelated)
refute Visibility.visible_for_user?(direct, unrelated)
end
test "doesn't die when the user doesn't exist",
%{
direct: direct,
user: user
} do
Repo.delete(user)
Cachex.clear(:user_cache)
refute Visibility.is_private?(direct)
end
end