add implementation for verify email for apiv4 (#5502)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
ace228c4e5
Коммит
7fc5dc236a
@@ -924,3 +924,29 @@ func TestGetAudits(t *testing.T) {
|
||||
_, resp = th.SystemAdminClient.GetAudits(user.Id, 0, 100, "")
|
||||
CheckNoError(t, resp)
|
||||
}
|
||||
|
||||
func TestVerify(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
defer TearDown()
|
||||
Client := th.Client
|
||||
|
||||
user := model.User{Email: GenerateTestEmail(), Nickname: "Darth Vader", Password: "hello1", Username: GenerateTestUsername(), Roles: model.ROLE_SYSTEM_ADMIN.Id + " " + model.ROLE_SYSTEM_USER.Id}
|
||||
|
||||
ruser, resp := Client.CreateUser(&user)
|
||||
|
||||
hashId := ruser.Id+utils.Cfg.EmailSettings.InviteSalt
|
||||
_, resp = Client.VerifyUserEmail(ruser.Id, hashId)
|
||||
CheckNoError(t, resp)
|
||||
|
||||
hashId = ruser.Id+GenerateTestId()
|
||||
_, resp = Client.VerifyUserEmail(ruser.Id, hashId)
|
||||
CheckBadRequestStatus(t, resp)
|
||||
|
||||
// Comment per request from Joram, he will investigate why it fail with a wrong status
|
||||
// hashId = ruser.Id+GenerateTestId()
|
||||
// _, resp = Client.VerifyUserEmail("", hashId)
|
||||
// CheckBadRequestStatus(t, resp)
|
||||
|
||||
_, resp = Client.VerifyUserEmail(ruser.Id, "")
|
||||
CheckBadRequestStatus(t, resp)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user