forked from YokaiRick/akkoma
Add test for blocked domains
This commit is contained in:
parent
62516be9c4
commit
64495b96e9
1 changed files with 14 additions and 0 deletions
|
@ -462,6 +462,20 @@ test "doesn't return announce activities concerning blocked users" do
|
|||
refute Enum.member?(activities, activity_three.id)
|
||||
end
|
||||
|
||||
test "doesn't return activities from blocked domains" do
|
||||
domain = "dogwhistle.zone"
|
||||
domain_user = insert(:user, %{ap_id: "https://#{domain}/@pundit"})
|
||||
note = insert(:note, %{data: %{"actor" => domain_user.ap_id}})
|
||||
activity = insert(:note_activity, %{note: note})
|
||||
user = insert(:user)
|
||||
{:ok, user} = User.block_domain(user, domain)
|
||||
|
||||
activities =
|
||||
ActivityPub.fetch_activities([], %{"blocking_user" => user, "skip_preload" => true})
|
||||
|
||||
refute activity in activities
|
||||
end
|
||||
|
||||
test "doesn't return muted activities" do
|
||||
activity_one = insert(:note_activity)
|
||||
activity_two = insert(:note_activity)
|
||||
|
|
Loading…
Reference in a new issue