diff options
author | rinpatch <rin@patch.cx> | 2021-02-12 08:48:51 +0000 |
---|---|---|
committer | rinpatch <rin@patch.cx> | 2021-02-12 08:48:51 +0000 |
commit | 76414ad277a52c55205ef2cdadd671ca4f07ddf9 (patch) | |
tree | 46f36797ff5eebc29bf8ae904d7120b12586ade9 | |
parent | 2cf753c5022dd7178d882e36e25b3a40dc403eff (diff) | |
parent | fb25231fbe57ed3ca27e277a35b7e376f1af26fa (diff) | |
download | pleroma-76414ad277a52c55205ef2cdadd671ca4f07ddf9.tar.gz |
Merge branch 'bugfix/answer-outbox' into 'develop'
Add test for Answer presence into an authenticated /outbox
See merge request pleroma/pleroma!3269
-rw-r--r-- | test/pleroma/web/activity_pub/activity_pub_controller_test.exs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/pleroma/web/activity_pub/activity_pub_controller_test.exs b/test/pleroma/web/activity_pub/activity_pub_controller_test.exs index 5e53b8afc..19e04d472 100644 --- a/test/pleroma/web/activity_pub/activity_pub_controller_test.exs +++ b/test/pleroma/web/activity_pub/activity_pub_controller_test.exs @@ -1101,6 +1101,31 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do assert response(conn, 200) =~ announce_activity.data["object"] end + + test "It returns poll Answers when authenticated", %{conn: conn} do + poller = insert(:user) + voter = insert(:user) + + {:ok, activity} = + CommonAPI.post(poller, %{ + status: "suya...", + poll: %{options: ["suya", "suya.", "suya.."], expires_in: 10} + }) + + assert question = Object.normalize(activity, fetch: false) + + {:ok, [activity], _object} = CommonAPI.vote(voter, question, [1]) + + assert outbox_get = + conn + |> assign(:user, voter) + |> put_req_header("accept", "application/activity+json") + |> get(voter.ap_id <> "/outbox?page=true") + |> json_response(200) + + assert [answer_outbox] = outbox_get["orderedItems"] + assert answer_outbox["id"] == activity.data["id"] + end end describe "POST /users/:nickname/outbox (C2S)" do |