summaryrefslogtreecommitdiffstats
path: root/tests/integration/api_admin_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/api_admin_test.go')
-rw-r--r--tests/integration/api_admin_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/integration/api_admin_test.go b/tests/integration/api_admin_test.go
index ff7c2ddca3..0748a75ba4 100644
--- a/tests/integration/api_admin_test.go
+++ b/tests/integration/api_admin_test.go
@@ -208,11 +208,11 @@ func TestAPIEditUser(t *testing.T) {
SourceID: 0,
Email: &empty,
}).AddTokenAuth(token)
- resp := MakeRequest(t, req, http.StatusUnprocessableEntity)
+ resp := MakeRequest(t, req, http.StatusBadRequest)
errMap := make(map[string]any)
json.Unmarshal(resp.Body.Bytes(), &errMap)
- assert.EqualValues(t, "email is not allowed to be empty string", errMap["message"].(string))
+ assert.EqualValues(t, "e-mail invalid [email: ]", errMap["message"].(string))
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{LoginName: "user2"})
assert.False(t, user2.IsRestricted)
@@ -254,14 +254,14 @@ func TestAPIRenameUser(t *testing.T) {
// required
"new_name": "User2",
}).AddTokenAuth(token)
- MakeRequest(t, req, http.StatusOK)
+ MakeRequest(t, req, http.StatusNoContent)
urlStr = fmt.Sprintf("/api/v1/admin/users/%s/rename", "User2")
req = NewRequestWithValues(t, "POST", urlStr, map[string]string{
// required
"new_name": "User2-2-2",
}).AddTokenAuth(token)
- MakeRequest(t, req, http.StatusOK)
+ MakeRequest(t, req, http.StatusNoContent)
req = NewRequestWithValues(t, "POST", urlStr, map[string]string{
// required
@@ -281,7 +281,7 @@ func TestAPIRenameUser(t *testing.T) {
// required
"new_name": "user2",
}).AddTokenAuth(token)
- MakeRequest(t, req, http.StatusOK)
+ MakeRequest(t, req, http.StatusNoContent)
}
func TestAPICron(t *testing.T) {