Fix the logic in multi-hashtag TLs
This commit is contained in:
parent
4ad0ad14ed
commit
5a84def6a6
4 changed files with 37 additions and 7 deletions
|
|
@ -81,9 +81,16 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
|||
"tag_reject" => ["reject"]
|
||||
})
|
||||
|
||||
fetch_four =
|
||||
ActivityPub.fetch_activities([], %{
|
||||
"tag" => ["test"],
|
||||
"tag_all" => ["test", "reject"]
|
||||
})
|
||||
|
||||
assert fetch_one == [status_one, status_three]
|
||||
assert fetch_two == [status_one, status_two, status_three]
|
||||
assert fetch_three == [status_one, status_two]
|
||||
assert fetch_four == [status_three]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1051,11 +1051,11 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
|
|||
{:ok, activity_test1} = CommonAPI.post(user, %{"status" => "#test1"})
|
||||
{:ok, activity_none} = CommonAPI.post(user, %{"status" => "#test #none"})
|
||||
|
||||
all_test =
|
||||
any_test =
|
||||
conn
|
||||
|> get("/api/v1/timelines/tag/test", %{"all" => ["test1"]})
|
||||
|> get("/api/v1/timelines/tag/test", %{"any" => ["none"]})
|
||||
|
||||
assert [status_none, status_test1, status_test] = json_response(all_test, 200)
|
||||
[status_none, status_test1, status_test] = json_response(any_test, 200)
|
||||
|
||||
assert to_string(activity_test.id) == status_test["id"]
|
||||
assert to_string(activity_test1.id) == status_test1["id"]
|
||||
|
|
@ -1066,6 +1066,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
|
|||
|> get("/api/v1/timelines/tag/test", %{"all" => ["test1"], "none" => ["none"]})
|
||||
|
||||
assert [status_test1, status_test] == json_response(restricted_test, 200)
|
||||
|
||||
all_test = conn |> get("/api/v1/timelines/tag/test", %{"all" => ["none"]})
|
||||
|
||||
assert [status_none] == json_response(all_test, 200)
|
||||
end
|
||||
|
||||
test "getting followers", %{conn: conn} do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue