From: Ilja Date: Tue, 5 Apr 2022 11:21:09 +0000 (+0200) Subject: Fix eratic test for POST /api/pleroma/admin/reports/:id/notes X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=e3107fee98bf33dc9a565a00804315c330811f73;p=akkoma 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 --- diff --git a/test/pleroma/web/admin_api/controllers/report_controller_test.exs b/test/pleroma/web/admin_api/controllers/report_controller_test.exs index 642b05f3f..2d526527b 100644 --- a/test/pleroma/web/admin_api/controllers/report_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/report_controller_test.exs @@ -369,7 +369,8 @@ defmodule Pleroma.Web.AdminAPI.ReportControllerTest do refute is_nil(note) 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