aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Filippov <colixer@gmail.com>2019-12-05 12:07:53 +0900
committerMaxim Filippov <colixer@gmail.com>2019-12-05 12:07:53 +0900
commit4453a9cb73ce80b8640f47f5222085f0507c2cfb (patch)
tree26e2e98c15ed0e760b66ec9e50eb095720a451dc
parent4b60d41db9d10e971ee91202389991da294c72de (diff)
downloadpleroma-4453a9cb73ce80b8640f47f5222085f0507c2cfb.tar.gz
Add failing test, which exposes a bug
-rw-r--r--test/web/admin_api/admin_api_controller_test.exs13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/web/admin_api/admin_api_controller_test.exs b/test/web/admin_api/admin_api_controller_test.exs
index 44557ea45..453c290e4 100644
--- a/test/web/admin_api/admin_api_controller_test.exs
+++ b/test/web/admin_api/admin_api_controller_test.exs
@@ -2926,6 +2926,12 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
content: "this is disgusting!"
})
+ build_conn()
+ |> assign(:user, admin)
+ |> post("/api/pleroma/admin/reports/#{report_id}/notes", %{
+ content: "this is disgusting2!"
+ })
+
%{
admin_id: admin.id,
report_id: report_id,
@@ -2947,12 +2953,13 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
|> assign(:user, admin)
|> get("/api/pleroma/admin/reports")
- reponse = json_response(conn, 200)
- notes = hd(reponse["reports"])["notes"]
- [note] = notes
+ response = json_response(conn, 200)
+ notes = hd(response["reports"])["notes"]
+ [note, _] = notes
assert note["user"]["nickname"] == admin.nickname
assert note["content"] == "this is disgusting!"
+ assert response["total"] == 1
end
end
end