summaryrefslogtreecommitdiff
path: root/password_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'password_test.go')
-rw-r--r--password_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/password_test.go b/password_test.go
index a0dfbc3..12f7aaa 100644
--- a/password_test.go
+++ b/password_test.go
@@ -87,3 +87,26 @@ func TestAuthenticate(t *testing.T) {
})
}
}
+
+func TestRegisterAuthenticate(t *testing.T) {
+ for _, p := range passwords {
+ t.Run(p.description, func(t *testing.T) {
+ db, _ := emptyDB(t)
+
+ err := MigrateToLatest(db)
+ if err != nil {
+ t.Fatalf("Could not execute function to test: %v", err)
+ }
+
+ err = Register(db, p.username, p.password)
+ if err != nil {
+ t.Fatalf("Could not register user: %v", err)
+ }
+
+ err = Authenticate(db, p.username, p.password)
+ if err != nil {
+ t.Fatalf("Failed to authenticate: %v", err)
+ }
+ })
+ }
+}