1
0

chore(deps): update golangci-lint rules

This commit is contained in:
kolaente
2023-12-19 13:34:31 +01:00
parent 48a173a563
commit c05f51b923
60 changed files with 999 additions and 921 deletions

View File

@ -22,7 +22,9 @@ import (
apiv1 "code.vikunja.io/api/pkg/routes/api/v1"
"code.vikunja.io/api/pkg/user"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestUserChangePassword(t *testing.T) {
@ -31,7 +33,7 @@ func TestUserChangePassword(t *testing.T) {
"new_password": "12345",
"old_password": "1234"
}`, nil, nil)
assert.NoError(t, err)
require.NoError(t, err)
assert.Contains(t, rec.Body.String(), `The password was updated successfully.`)
})
t.Run("Wrong old password", func(t *testing.T) {
@ -39,7 +41,7 @@ func TestUserChangePassword(t *testing.T) {
"new_password": "12345",
"old_password": "invalid"
}`, nil, nil)
assert.Error(t, err)
require.Error(t, err)
assertHandlerErrorCode(t, err, user.ErrCodeWrongUsernameOrPassword)
})
t.Run("Empty old password", func(t *testing.T) {
@ -47,7 +49,7 @@ func TestUserChangePassword(t *testing.T) {
"new_password": "12345",
"old_password": ""
}`, nil, nil)
assert.Error(t, err)
require.Error(t, err)
assertHandlerErrorCode(t, err, user.ErrCodeEmptyOldPassword)
})
t.Run("Empty new password", func(t *testing.T) {
@ -55,7 +57,7 @@ func TestUserChangePassword(t *testing.T) {
"new_password": "",
"old_password": "1234"
}`, nil, nil)
assert.Error(t, err)
require.Error(t, err)
assertHandlerErrorCode(t, err, user.ErrCodeEmptyNewPassword)
})
}