1
0
mirror of https://github.com/volatiletech/authboss.git synced 2024-11-28 08:58:38 +02:00
authboss/authboss_test.go
2018-03-09 13:11:08 -08:00

35 lines
540 B
Go

package authboss
import (
"context"
"testing"
)
func TestAuthBossInit(t *testing.T) {
t.Parallel()
ab := New()
err := ab.Init()
if err != nil {
t.Error("Unexpected error:", err)
}
}
func TestAuthbossUpdatePassword(t *testing.T) {
t.Parallel()
user := &mockUser{}
storer := newMockServerStorer()
ab := New()
ab.Config.Storage.Server = storer
if err := ab.UpdatePassword(context.Background(), user, "hello world"); err != nil {
t.Error(err)
}
if len(user.Password) == 0 {
t.Error("password was not updated")
}
}