Actually, update the existing test

Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
mkljczk 2025-03-01 19:55:30 +01:00
parent 0354ff06d8
commit 4d54f2cb67
3 changed files with 5 additions and 27 deletions

View file

@ -1 +1 @@
Optimize followed hashtag ids query, add test for hashtags in home timeline
Optimize followed hashtag ids query

View file

@ -873,6 +873,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
user = insert(:user)
other_user = insert(:user)
{:ok, other_user} = User.follow_hashtag(other_user, hashtag)
{:ok, normally_visible} =
CommonAPI.post(other_user, %{status: "hello :)", visibility: "public"})
@ -883,7 +885,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
activities =
ActivityPub.fetch_activities([other_user.follower_address], %{
followed_hashtags: [hashtag.id]
user: other_user,
with_followed_hashtags: true
})
assert length(activities) == 3

View file

@ -149,31 +149,6 @@ defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do
|> get("/api/v1/timelines/home?remote=true&local=true")
|> json_response_and_validate_schema(200) == []
end
test "includes followed hashtags", %{conn: conn, user: user} do
hashtag = insert(:hashtag, %{name: "tenshi"})
other_user = insert(:user)
{:ok, user} = User.follow_hashtag(user, hashtag)
{:ok, _} = CommonAPI.post(other_user, %{status: "hey #tenshi"})
{:ok, _} = CommonAPI.post(other_user, %{status: "hey #anotherhashtag"})
result =
conn
|> assign(:user, user)
|> get("/api/v1/timelines/home")
|> json_response_and_validate_schema(200)
assert [
%{
"tags" => [
%{
"name" => "tenshi"
}
]
}
] = result
end
end
describe "public" do