Joe Chen 1 year ago
parent
commit
0ca926e87b
2 changed files with 3 additions and 6 deletions
  1. 2 0
      internal/db/organizations_test.go
  2. 1 6
      internal/db/users_test.go

+ 2 - 0
internal/db/organizations_test.go

@@ -208,6 +208,8 @@ func orgsList(t *testing.T, ctx context.Context, db *organizations) {
 func orgsSearchByName(t *testing.T, ctx context.Context, db *organizations) {
 	tempPictureAvatarUploadPath := filepath.Join(os.TempDir(), "orgsSearchByName-tempPictureAvatarUploadPath")
 	conf.SetMockPicture(t, conf.PictureOpts{AvatarUploadPath: tempPictureAvatarUploadPath})
+	tempRepositoryRoot := filepath.Join(os.TempDir(), "orgsSearchByName-tempRepositoryRoot")
+	conf.SetMockRepository(t, conf.RepositoryOpts{Root: tempRepositoryRoot})
 
 	org1, err := db.Create(ctx, "org1", 1, CreateOrganizationOptions{FullName: "Acme Corp"})
 	require.NoError(t, err)

+ 1 - 6
internal/db/users_test.go

@@ -277,12 +277,7 @@ func usersChangeUsername(t *testing.T, ctx context.Context, db *users) {
 	})
 
 	tempRepositoryRoot := filepath.Join(os.TempDir(), "usersChangeUsername-tempRepositoryRoot")
-	conf.SetMockRepository(
-		t,
-		conf.RepositoryOpts{
-			Root: tempRepositoryRoot,
-		},
-	)
+	conf.SetMockRepository(t, conf.RepositoryOpts{Root: tempRepositoryRoot})
 	err = os.RemoveAll(tempRepositoryRoot)
 	require.NoError(t, err)
 	defer func() { _ = os.RemoveAll(tempRepositoryRoot) }()