aboutsummaryrefslogtreecommitdiff
path: root/internal/db/two_factors_test.go
diff options
context:
space:
mode:
authorJoe Chen <jc@unknwon.io>2022-10-23 21:22:36 +0800
committerGitHub <noreply@github.com>2022-10-23 21:22:36 +0800
commit3265abfbc22ef36871d8e69f0f9a3a4a5b40b768 (patch)
tree0079202cdf2e84f7366ba1b1b8064233721f093c /internal/db/two_factors_test.go
parentd0a4a3401c1c62def511df42769b13cdfba10a6a (diff)
refactor(db): migrate perms methods off `user.go` (#7207)
Diffstat (limited to 'internal/db/two_factors_test.go')
-rw-r--r--internal/db/two_factors_test.go8
1 files changed, 4 insertions, 4 deletions
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))
}