mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-05-02 18:06:54 +00:00
test: add web test for disabled user password reset rejection
This commit is contained in:
@@ -65,4 +65,12 @@ func TestUserPasswordReset(t *testing.T) {
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, http.StatusPreconditionFailed, getHTTPErrorCode(err))
|
||||
})
|
||||
t.Run("Disabled user cannot reset password", func(t *testing.T) {
|
||||
_, err := newTestRequest(t, http.MethodPost, apiv1.UserResetPassword, `{
|
||||
"new_password": "12345678",
|
||||
"token": "disableduserpasswordresettoken"
|
||||
}`, nil, nil)
|
||||
require.Error(t, err)
|
||||
assertHandlerErrorCode(t, err, user.ErrCodeAccountDisabled)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user