From 3265abfbc22ef36871d8e69f0f9a3a4a5b40b768 Mon Sep 17 00:00:00 2001 From: Joe Chen Date: Sun, 23 Oct 2022 21:22:36 +0800 Subject: refactor(db): migrate perms methods off `user.go` (#7207) --- internal/db/two_factors_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/db/two_factors_test.go') diff --git a/internal/db/two_factors_test.go b/internal/db/two_factors_test.go index 386e96ca..36e4eeca 100644 --- a/internal/db/two_factors_test.go +++ b/internal/db/two_factors_test.go @@ -58,7 +58,7 @@ func TestTwoFactors(t *testing.T) { }{ {"Create", twoFactorsCreate}, {"GetByUserID", twoFactorsGetByUserID}, - {"IsUserEnabled", twoFactorsIsUserEnabled}, + {"IsEnabled", twoFactorsIsEnabled}, } { t.Run(tc.name, func(t *testing.T) { t.Cleanup(func() { @@ -109,13 +109,13 @@ func twoFactorsGetByUserID(t *testing.T, db *twoFactors) { assert.Equal(t, wantErr, err) } -func twoFactorsIsUserEnabled(t *testing.T, db *twoFactors) { +func twoFactorsIsEnabled(t *testing.T, db *twoFactors) { ctx := context.Background() // Create a 2FA token for user 1 err := db.Create(ctx, 1, "secure-key", "secure-secret") require.NoError(t, err) - assert.True(t, db.IsUserEnabled(ctx, 1)) - assert.False(t, db.IsUserEnabled(ctx, 2)) + assert.True(t, db.IsEnabled(ctx, 1)) + assert.False(t, db.IsEnabled(ctx, 2)) } -- cgit v1.2.3