Fix eratic test for POST /api/pleroma/admin/reports/:id/notes
It retrieved two ReportNotes and then checked one of them. But the order isn't guaranteed, while the test tested on the content of the first ReportNote. I made the test on the content more generic
This commit is contained in:
parent
57faa36243
commit
d48ade7629
1 changed files with 2 additions and 2 deletions
|
@ -355,7 +355,6 @@ test "it creates report note", %{admin_id: admin_id, report_id: report_id} do
|
|||
} = note
|
||||
end
|
||||
|
||||
@tag :erratic
|
||||
test "it returns reports with notes", %{conn: conn, admin: admin} do
|
||||
conn = get(conn, "/api/pleroma/admin/reports")
|
||||
|
||||
|
@ -364,7 +363,8 @@ test "it returns reports with notes", %{conn: conn, admin: admin} do
|
|||
[note, _] = notes
|
||||
|
||||
assert note["user"]["nickname"] == admin.nickname
|
||||
assert note["content"] == "this is disgusting!"
|
||||
# We use '=~' because the order of the notes isn't guaranteed
|
||||
assert note["content"] =~ "this is disgusting"
|
||||
assert note["created_at"]
|
||||
assert response["total"] == 1
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue