From cd8f9be232a145fa52405635fcd63e3e930a74bb Mon Sep 17 00:00:00 2001 From: raararaara Date: Tue, 9 Jan 2024 15:44:10 +0900 Subject: [PATCH] Update FindProjectInfoBySecretKey test Update FindProjectInfoBySecretKey test --- server/backend/database/testcases/testcases.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/server/backend/database/testcases/testcases.go b/server/backend/database/testcases/testcases.go index a972711ee..23772ad61 100644 --- a/server/backend/database/testcases/testcases.go +++ b/server/backend/database/testcases/testcases.go @@ -80,14 +80,16 @@ func RunFindProjectInfoBySecretKeyTest( t.Run("FindProjectInfoBySecretKey test", func(t *testing.T) { ctx := context.Background() - info1, err := db.CreateProjectInfo(ctx, t.Name(), dummyOwnerID, clientDeactivateThreshold) - assert.NoError(t, err) - _, err = db.CreateProjectInfo(ctx, t.Name(), otherOwnerID, clientDeactivateThreshold) + username := "admin@yorkie.dev" + password := "hashed-password" + + _, project, err := db.EnsureDefaultUserAndProject(ctx, username, password, clientDeactivateThreshold) assert.NoError(t, err) - info2, err := db.FindProjectInfoBySecretKey(ctx, info1.SecretKey) + info2, err := db.FindProjectInfoBySecretKey(ctx, project.SecretKey) assert.NoError(t, err) - assert.Equal(t, info1.ID, info2.ID) + + assert.Equal(t, project.ID, info2.ID) }) }