Commit ca3b4de2 authored by Ivan Tashkinov's avatar Ivan Tashkinov

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

parent 00d08c92
......@@ -1363,9 +1363,9 @@ test "returns 404 when report id is invalid", %{conn: conn} 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 @@ test "requires write:reports scope", %{conn: conn, id: id, admin: admin} do
|> json_response(403)
assert response == %{
"error" => "Insufficient permissions: admin:write:reports | write:reports."
"error" => "Insufficient permissions: admin:write:reports."
}
conn
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment