aboutsummaryrefslogtreecommitdiff
path: root/pkg/database/sql/user_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/database/sql/user_test.go')
-rw-r--r--pkg/database/sql/user_test.go12
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",
}