From e534f2774559ec00350d11bbdd3b3be5cdaf732e Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Mon, 5 Dec 2022 12:54:26 +0000 Subject: [PATCH] Add test to make sure the join is correct --- test/pleroma/web/activity_pub/activity_pub_test.exs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/pleroma/web/activity_pub/activity_pub_test.exs b/test/pleroma/web/activity_pub/activity_pub_test.exs index fc452ef1a..1ba1ad96a 100644 --- a/test/pleroma/web/activity_pub/activity_pub_test.exs +++ b/test/pleroma/web/activity_pub/activity_pub_test.exs @@ -723,17 +723,20 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do test "it should return public activities that reference a given hashtag" do hashtag = insert(:hashtag, name: "tenshi") user = insert(:user) + other_user = insert(:user) + {:ok, normally_visible} = CommonAPI.post(other_user, %{status: "hello :)", visibility: "public"}) {:ok, public} = CommonAPI.post(user, %{status: "maji #tenshi", visibility: "public"}) {:ok, _unrelated} = CommonAPI.post(user, %{status: "dai #tensh", visibility: "public"}) {:ok, unlisted} = CommonAPI.post(user, %{status: "maji #tenshi", visibility: "unlisted"}) {:ok, _private} = CommonAPI.post(user, %{status: "maji #tenshi", visibility: "private"}) - activities = ActivityPub.fetch_activities([], %{followed_hashtags: [hashtag.id]}) - assert length(activities) == 2 + activities = ActivityPub.fetch_activities([other_user.follower_address], %{followed_hashtags: [hashtag.id]}) + assert length(activities) == 3 + normal_id = normally_visible.id public_id = public.id unlisted_id = unlisted.id - assert [%{id: ^public_id}, %{id: ^unlisted_id}] = activities + assert [%{id: ^normal_id}, %{id: ^public_id}, %{id: ^unlisted_id}] = activities end end