mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-04-07 02:59:54 +00:00
Actually, update the existing test
Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
parent
0354ff06d8
commit
4d54f2cb67
3 changed files with 5 additions and 27 deletions
|
@ -1 +1 @@
|
|||
Optimize followed hashtag ids query, add test for hashtags in home timeline
|
||||
Optimize followed hashtag ids query
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue