Test the note is returned when fetching a single report

This commit is contained in:
Mark Felder 2020-11-02 15:49:07 -06:00
parent 7efc074ead
commit 53dd048590
1 changed files with 9 additions and 0 deletions

View File

@ -37,12 +37,21 @@ test "returns report by its id", %{conn: conn} do
status_ids: [activity.id] status_ids: [activity.id]
}) })
conn
|> put_req_header("content-type", "application/json")
|> post("/api/pleroma/admin/reports/#{report_id}/notes", %{
content: "this is an admin note"
})
response = response =
conn conn
|> get("/api/pleroma/admin/reports/#{report_id}") |> get("/api/pleroma/admin/reports/#{report_id}")
|> json_response_and_validate_schema(:ok) |> json_response_and_validate_schema(:ok)
assert response["id"] == report_id assert response["id"] == report_id
[notes] = response["notes"]
assert notes["content"] == "this is an admin note"
end end
test "returns 404 when report id is invalid", %{conn: conn} do test "returns 404 when report id is invalid", %{conn: conn} do