Implement DELETE /users/{user_id endpoint for APIv4 - rebase cleanup (#5307)
* added delete user endpoint * added unit test for delete user endpoint * added delete user driver
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
aa75f981e1
Коммит
fc43bf0581
@@ -219,6 +219,37 @@ func TestUpdateUser(t *testing.T) {
|
||||
CheckNoError(t, resp)
|
||||
}
|
||||
|
||||
func TestDeleteUser(t *testing.T) {
|
||||
th := Setup().InitBasic().InitSystemAdmin()
|
||||
Client := th.Client
|
||||
|
||||
user := th.BasicUser
|
||||
th.LoginBasic()
|
||||
|
||||
testUser := th.SystemAdminUser
|
||||
_, resp := Client.DeleteUser(testUser.Id)
|
||||
CheckForbiddenStatus(t, resp)
|
||||
|
||||
Client.Logout()
|
||||
|
||||
_, resp = Client.DeleteUser(user.Id)
|
||||
CheckUnauthorizedStatus(t, resp)
|
||||
|
||||
Client.Login(testUser.Email, testUser.Password)
|
||||
|
||||
user.Id = model.NewId()
|
||||
_, resp = Client.DeleteUser(user.Id)
|
||||
CheckNotFoundStatus(t, resp)
|
||||
|
||||
user.Id = "junk"
|
||||
_, resp = Client.DeleteUser(user.Id)
|
||||
CheckBadRequestStatus(t, resp)
|
||||
|
||||
_, resp = Client.DeleteUser(testUser.Id)
|
||||
CheckNoError(t, resp)
|
||||
|
||||
}
|
||||
|
||||
func TestUpdateUserRoles(t *testing.T) {
|
||||
th := Setup().InitBasic().InitSystemAdmin()
|
||||
Client := th.Client
|
||||
|
||||
Ссылка в новой задаче
Block a user