diff options
author | lain <lain@soykaf.club> | 2020-05-12 12:50:48 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-12 12:50:48 +0200 |
commit | dfb90a1fd64cfb8f81707d939a87a02e8047dc3b (patch) | |
tree | 6f97f34bc833b9a636f1cf1cd3f05fe74ec56b49 /test/web/mastodon_api | |
parent | f8190aea5e68a6e17ccc88b13486bd69c3b08450 (diff) | |
download | pleroma-dfb90a1fd64cfb8f81707d939a87a02e8047dc3b.tar.gz |
Transmogrifier: Add tests for certain announces
Diffstat (limited to 'test/web/mastodon_api')
-rw-r--r-- | test/web/mastodon_api/controllers/account_controller_test.exs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/web/mastodon_api/controllers/account_controller_test.exs b/test/web/mastodon_api/controllers/account_controller_test.exs index 256a8b304..0d48ae4ae 100644 --- a/test/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/web/mastodon_api/controllers/account_controller_test.exs @@ -222,6 +222,33 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do describe "user timelines" do setup do: oauth_access(["read:statuses"]) + test "works with announces that are just addressed to public", %{conn: conn} do + user = insert(:user, ap_id: "https://honktest/u/test", local: false) + other_user = insert(:user) + + {:ok, post} = CommonAPI.post(other_user, %{"status" => "bonkeronk"}) + + {:ok, announce, _} = + %{ + "@context" => "https://www.w3.org/ns/activitystreams", + "actor" => "https://honktest/u/test", + "id" => "https://honktest/u/test/bonk/1793M7B9MQ48847vdx", + "object" => post.data["object"], + "published" => "2019-06-25T19:33:58Z", + "to" => ["https://www.w3.org/ns/activitystreams#Public"], + "type" => "Announce" + } + |> ActivityPub.persist(local: false) + + assert resp = + conn + |> get("/api/v1/accounts/#{user.id}/statuses") + |> json_response_and_validate_schema(200) + + assert [%{"id" => id}] = resp + assert id == announce.id + end + test "respects blocks", %{user: user_one, conn: conn} do user_two = insert(:user) user_three = insert(:user) |