Small improvements to unit tests
the build was successful Details

This commit is contained in:
konrad 2018-01-25 16:28:02 +01:00 committed by kolaente
parent 66b6dbf4f3
commit 96ad0fc31b
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 11 additions and 1 deletions

View File

@ -50,10 +50,20 @@ func TestCreateUser(t *testing.T) {
assert.True(t, IsErrNoUsernamePassword(err))
// Check if he exists
_, exists, err := GetUser(createdUser)
theuser, exists, err := GetUser(createdUser)
assert.NoError(t, err)
assert.True(t, exists)
// Get by his ID
_, exists, err = GetUserByID(theuser.ID)
assert.NoError(t, err)
assert.True(t, exists)
// Passing 0 as ID should return an empty user
_, exists, err = GetUserByID(0)
assert.NoError(t, err)
assert.False(t, exists)
// Check the user credentials
user, err := CheckUserCredentials(&UserLogin{"testuu", "1234"})
assert.NoError(t, err)