moved to struct validation;
This commit is contained in:
@@ -221,8 +221,8 @@ func testLoginHandler(t *testing.T) (string, http.Cookie) {
|
||||
}
|
||||
assert.NotEmpty(t, loginCookie)
|
||||
} else {
|
||||
assert.Contains(t, response, "error")
|
||||
assert.NotEmpty(t, response["error"])
|
||||
assert.Contains(t, response, "errors")
|
||||
assert.NotEmpty(t, response["errors"])
|
||||
}
|
||||
})
|
||||
|
||||
@@ -585,7 +585,7 @@ func testUpdateUser(t *testing.T, loginCookie http.Cookie) {
|
||||
},
|
||||
expectedStatus: http.StatusForbidden,
|
||||
expectedErrors: []map[string]string{
|
||||
{"field": "general", "key": "server.error.unauthorized_update"},
|
||||
{"field": "user", "key": "server.error.unauthorized"},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -623,6 +623,7 @@ func testUpdateUser(t *testing.T, loginCookie http.Cookie) {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
// Create a copy of the user and apply the updates
|
||||
updatedUser := user
|
||||
logger.Error.Printf("user to be updated: %+v", user.Licence)
|
||||
tt.updateFunc(&updatedUser)
|
||||
// Convert user to JSON
|
||||
jsonData, err := json.Marshal(updatedUser)
|
||||
|
||||
Reference in New Issue
Block a user