mirror of
https://github.com/go-gitea/gitea
synced 2024-11-18 08:04:25 +00:00
2da1dcfc21
Fix #30518
26 lines
628 B
Go
26 lines
628 B
Go
// Copyright 2024 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package integration
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
auth_model "code.gitea.io/gitea/models/auth"
|
|
"code.gitea.io/gitea/tests"
|
|
)
|
|
|
|
func TestAPIUpdateUser(t *testing.T) {
|
|
defer tests.PrepareTestEnv(t)()
|
|
|
|
normalUsername := "user2"
|
|
session := loginUser(t, normalUsername)
|
|
token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeWriteUser)
|
|
|
|
req := NewRequestWithJSON(t, "PATCH", "/api/v1/user/settings", map[string]string{
|
|
"website": "https://gitea.com",
|
|
}).AddTokenAuth(token)
|
|
MakeRequest(t, req, http.StatusOK)
|
|
}
|