mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
Merge branch 'bugfix/answer-outbox' into 'develop'
Add test for Answer presence into an authenticated /outbox See merge request pleroma/pleroma!3269
This commit is contained in:
commit
76414ad277
1 changed files with 25 additions and 0 deletions
|
@ -1101,6 +1101,31 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
|
||||||
|
|
||||||
assert response(conn, 200) =~ announce_activity.data["object"]
|
assert response(conn, 200) =~ announce_activity.data["object"]
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
describe "POST /users/:nickname/outbox (C2S)" do
|
describe "POST /users/:nickname/outbox (C2S)" do
|
||||||
|
|
Loading…
Reference in a new issue