[#1521] AdminApiControllerTest: fixed create report test (OAuth).
authorIvan Tashkinov <ivantashkinov@gmail.com>
Mon, 20 Jan 2020 17:04:25 +0000 (20:04 +0300)
committerIvan Tashkinov <ivantashkinov@gmail.com>
Mon, 20 Jan 2020 17:04:25 +0000 (20:04 +0300)
test/web/admin_api/admin_api_controller_test.exs

index d11b26207f18909767a4d79c04e340f5442824ca..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