mirror of
https://github.com/gravitl/netmaker.git
synced 2026-01-10 21:04:11 +08:00
fix user tests
This commit is contained in:
parent
3836bd1d36
commit
b9126c7fa3
1 changed files with 4 additions and 0 deletions
|
|
@ -186,6 +186,7 @@ func TestGetUsers(t *testing.T) {
|
|||
assert.Equal(t, []models.ReturnUser(nil), admin)
|
||||
})
|
||||
t.Run("UserExisits", func(t *testing.T) {
|
||||
user.UserName = "anotheruser"
|
||||
if err := logic.CreateUser(&adminUser); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
|
@ -281,6 +282,9 @@ func TestVerifyAuthRequest(t *testing.T) {
|
|||
assert.EqualError(t, err, "error retrieving user from db: could not find any records")
|
||||
})
|
||||
t.Run("Non-Admin", func(t *testing.T) {
|
||||
user.IsAdmin = false
|
||||
user.Password = "somepass"
|
||||
user.UserName = "nonadmin"
|
||||
if err := logic.CreateUser(&user); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue