Merge branch '1521-admin-report-test-fix' into 'develop'

[#1521] AdminApiControllerTest fix: fixed create report test (OAuth)

Closes #1521

See merge request pleroma/pleroma!2121
This commit is contained in:
lain 2020-01-20 17:10:23 +00:00
commit ab36459464

View 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