mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-07 16:16:37 +08:00
refactor(user): decouple repository from direct database infra import
This commit is contained in:
@@ -36,7 +36,10 @@ func setupTestDB(t *testing.T) *gorm.DB {
|
||||
|
||||
func TestUserPluginUnit(t *testing.T) {
|
||||
ctx := core.NewContext(context.Background())
|
||||
_ = setupTestDB(t)
|
||||
testDB := setupTestDB(t)
|
||||
|
||||
dbPlugin := database.New(database.WithDB(testDB))
|
||||
require.NoError(t, dbPlugin.Apply(ctx))
|
||||
|
||||
p := user.New()
|
||||
assert.Equal(t, "user", p.Name())
|
||||
|
||||
Reference in New Issue
Block a user