mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 10:09:02 +00:00
Add test.
This commit is contained in:
parent
29376fcc13
commit
ec531ca281
|
@ -327,7 +327,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
activity in query,
|
||||
where:
|
||||
fragment(
|
||||
"not (?->'cc' \\?| ?)",
|
||||
"(?->'to' \\?| ?)",
|
||||
activity.data,
|
||||
^["https://www.w3.org/ns/activitystreams#Public"]
|
||||
)
|
||||
|
|
|
@ -171,6 +171,16 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
|||
end
|
||||
|
||||
describe "public fetch activities" do
|
||||
test "doesn't retrieve unlisted activities" do
|
||||
user = insert(:user)
|
||||
{:ok, unlisted_activity} = CommonAPI.post(user, %{"status" => "yeah", "visibility" => "unlisted"})
|
||||
{:ok, listed_activity} = CommonAPI.post(user, %{"status" => "yeah"})
|
||||
|
||||
[activity] = ActivityPub.fetch_public_activities()
|
||||
|
||||
assert activity == listed_activity
|
||||
end
|
||||
|
||||
test "retrieves public activities" do
|
||||
_activities = ActivityPub.fetch_public_activities()
|
||||
|
||||
|
|
Loading…
Reference in a new issue