1
0

when ID = 0 is passed to a 'GetSthByID'-function, it now returns a 'not exist' error

This commit is contained in:
kolaente
2018-09-13 20:07:11 +02:00
parent 716b06feff
commit 382daac0dd
9 changed files with 25 additions and 9 deletions

View File

@ -67,9 +67,10 @@ func TestCreateUser(t *testing.T) {
_, err = GetUserByID(theuser.ID)
assert.NoError(t, err)
// Passing 0 as ID should return an empty user
// Passing 0 as ID should return an error
_, err = GetUserByID(0)
assert.NoError(t, err)
assert.Error(t, err)
assert.True(t, IsErrUserDoesNotExist(err))
// Check the user credentials
user, err := CheckUserCredentials(&UserLogin{"testuu", "1234"})