X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Fadmin_api%2Fcontrollers%2Freport_controller_test.exs;h=2d526527b2ee8967730b813e80578484b4efd5f8;hb=0f132b802dde7f217ecb07767e0d34e3edb517b7;hp=8102845d57a8ee61d038016c2f251bdafb3182dc;hpb=1841bd8383d7734cb74cff91f61dc7e1fdfad13d;p=akkoma 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 8102845d5..2d526527b 100644 --- a/test/pleroma/web/admin_api/controllers/report_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/report_controller_test.exs @@ -204,9 +204,7 @@ defmodule Pleroma.Web.AdminAPI.ReportControllerTest do "@#{admin.nickname} updated report ##{id} (on user @#{activity.user_actor.nickname}) with 'resolved' state" assert ModerationLog.get_log_entry_message(second_log_entry) == - "@#{admin.nickname} updated report ##{second_report_id} (on user @#{ - second_activity.user_actor.nickname - }) with 'closed' state" + "@#{admin.nickname} updated report ##{second_report_id} (on user @#{second_activity.user_actor.nickname}) with 'closed' state" end end @@ -362,10 +360,17 @@ defmodule Pleroma.Web.AdminAPI.ReportControllerTest do response = json_response_and_validate_schema(conn, 200) notes = hd(response["reports"])["notes"] - [note, _] = notes + assert 2 == Enum.count(notes) + + note = + notes + |> Enum.find(fn note -> note["content"] == "this is disgusting!" end) + + 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