Merge branch 'develop' into fix/attachments-cleanup
[akkoma] / test / web / admin_api / admin_api_controller_test.exs
index 12077135c1dcde70002203158cad687253a42b6c..c8f8ba310e33be8944b05e581670dee6664f8ae0 100644 (file)
@@ -1363,9 +1363,9 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
       }
     end
 
-    test "requires write:reports scope", %{conn: conn, id: id, admin: admin} do
-      read_token = insert(:oauth_token, user: admin, scopes: ["read"])
-      write_token = insert(:oauth_token, user: admin, scopes: ["write:reports"])
+    test "requires admin:write:reports scope", %{conn: conn, id: id, admin: admin} do
+      read_token = insert(:oauth_token, user: admin, scopes: ["admin:read"])
+      write_token = insert(:oauth_token, user: admin, scopes: ["admin:write:reports"])
 
       response =
         conn
@@ -1376,7 +1376,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
         |> json_response(403)
 
       assert response == %{
-               "error" => "Insufficient permissions: admin:write:reports | write:reports."
+               "error" => "Insufficient permissions: admin:write:reports."
              }
 
       conn
@@ -2864,7 +2864,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
 
       response = json_response(ret_conn, 200)
 
-      assert length(response) == 0
+      assert Enum.empty?(response)
     end
   end