From: Roger Braun Date: Sun, 5 Nov 2017 11:12:19 +0000 (+0100) Subject: Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into develop X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=7252f6b054dfdfac1f9bac77c442c5a1ebd898af;p=akkoma Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into develop --- 7252f6b054dfdfac1f9bac77c442c5a1ebd898af diff --cc test/web/activity_pub/activity_pub_test.exs index 48597f5fb,a02740d5d..2cd33d623 --- a/test/web/activity_pub/activity_pub_test.exs +++ b/test/web/activity_pub/activity_pub_test.exs @@@ -80,10 -83,32 +83,34 @@@ defmodule Pleroma.Web.ActivityPub.Activ end end + test "doesn't return blocked activities" do + activity_one = insert(:note_activity) + activity_two = insert(:note_activity) + user = insert(:user) + {:ok, user} = User.block(user, %{ap_id: activity_one.data["actor"]}) + + activities = ActivityPub.fetch_activities([], %{"blocking_user" => user}) + + assert Enum.member?(activities, activity_two) + refute Enum.member?(activities, activity_one) + + {:ok, user} = User.unblock(user, %{ap_id: activity_one.data["actor"]}) + + activities = ActivityPub.fetch_activities([], %{"blocking_user" => user}) + + assert Enum.member?(activities, activity_two) + assert Enum.member?(activities, activity_one) + + activities = ActivityPub.fetch_activities([], %{"blocking_user" => nil}) + + assert Enum.member?(activities, activity_two) + assert Enum.member?(activities, activity_one) + end + describe "public fetch activities" do test "retrieves public activities" do + activities = ActivityPub.fetch_public_activities + %{public: public} = ActivityBuilder.public_and_non_public activities = ActivityPub.fetch_public_activities