}
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
|> json_response(403)
assert response == %{
- "error" => "Insufficient permissions: admin:write:reports | write:reports."
+ "error" => "Insufficient permissions: admin:write:reports."
}
conn