diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-06-26 22:59:03 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-06-26 22:59:03 +0200 |
commit | 9ba53fea71728ce64342d0d59f4199876e4b6164 (patch) | |
tree | 5f06ef37ab8ac3d01a3a7c21b5c71b1e9fc11643 /pkg/database/sql/user_test.go | |
parent | 4d930c0c8cb585979798fac2bb254f991faa62fb (diff) | |
download | lens-9ba53fea71728ce64342d0d59f4199876e4b6164.tar.gz lens-9ba53fea71728ce64342d0d59f4199876e4b6164.tar.bz2 lens-9ba53fea71728ce64342d0d59f4199876e4b6164.zip |
feat: Partially fix test
This will totally be fixed later.
Diffstat (limited to 'pkg/database/sql/user_test.go')
-rw-r--r-- | pkg/database/sql/user_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/database/sql/user_test.go b/pkg/database/sql/user_test.go index 473ce03..f0d89ad 100644 --- a/pkg/database/sql/user_test.go +++ b/pkg/database/sql/user_test.go @@ -48,7 +48,7 @@ func TestCreate(t *testing.T) { repository := NewUserRepository(db) - err := repository.Create(context.Background(), &user.CreateUser{ + id, err := repository.Create(context.Background(), &user.CreateUser{ Username: "new_username", Name: "new_name", }) @@ -56,12 +56,12 @@ func TestCreate(t *testing.T) { t.Fatalf("Error creating: %s", err.Error()) } - got, err := repository.Get(context.Background(), 1) + got, err := repository.Get(context.Background(), id) if err != nil { t.Fatalf("Error getting: %s", err.Error()) } want := &user.User{ - ID: 1, + ID: id, Username: "new_username", Name: "new_name", } @@ -78,7 +78,7 @@ func TestUpdate(t *testing.T) { repository := NewUserRepository(db) - err := repository.Create(context.Background(), &user.CreateUser{ + id, err := repository.Create(context.Background(), &user.CreateUser{ Username: "username", Name: "name", }) @@ -86,7 +86,7 @@ func TestUpdate(t *testing.T) { t.Fatalf("Error creating user: %s", err.Error()) } - err = repository.Update(context.Background(), 1, &user.UpdateUser{ + err = repository.Update(context.Background(), id, &user.UpdateUser{ Username: "new_username", Name: "new_name", }) @@ -99,7 +99,7 @@ func TestUpdate(t *testing.T) { t.Fatalf("Error getting user: %s", err.Error()) } want := &user.User{ - ID: 1, + ID: id, Username: "new_username", Name: "new_name", } |