aboutsummaryrefslogtreecommitdiff
path: root/pkg/database/sql/user_test.go
diff options
context:
space:
mode:
authorGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-06-29 23:21:56 +0200
committerGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-06-29 23:21:56 +0200
commit1ae70dbd9124675d4a510954619b01edd5f1f6c3 (patch)
treee6db7f5553a00094d048b6a4d03163853a5a4e7c /pkg/database/sql/user_test.go
parent024da3e546e98cbaeea5f7bc86af12b671996f41 (diff)
downloadlens-1ae70dbd9124675d4a510954619b01edd5f1f6c3.tar.gz
lens-1ae70dbd9124675d4a510954619b01edd5f1f6c3.tar.bz2
lens-1ae70dbd9124675d4a510954619b01edd5f1f6c3.zip
ref: Move away other repositories
Finish moving all repositories to a repository package. This should reduce the amount of packages.
Diffstat (limited to 'pkg/database/sql/user_test.go')
-rw-r--r--pkg/database/sql/user_test.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/pkg/database/sql/user_test.go b/pkg/database/sql/user_test.go
index f0d89ad..01f6729 100644
--- a/pkg/database/sql/user_test.go
+++ b/pkg/database/sql/user_test.go
@@ -12,7 +12,7 @@ import (
"gorm.io/gorm"
"gorm.io/gorm/logger"
- "git.sr.ht/~gabrielgio/img/pkg/components/user"
+ "git.sr.ht/~gabrielgio/img/pkg/database/repository"
)
func setup(t *testing.T) (*gorm.DB, func()) {
@@ -46,9 +46,9 @@ func TestCreate(t *testing.T) {
db, tearDown := setup(t)
defer tearDown()
- repository := NewUserRepository(db)
+ userRepository := NewUserRepository(db)
- id, err := repository.Create(context.Background(), &user.CreateUser{
+ id, err := userRepository.Create(context.Background(), &repository.CreateUser{
Username: "new_username",
Name: "new_name",
})
@@ -56,11 +56,11 @@ func TestCreate(t *testing.T) {
t.Fatalf("Error creating: %s", err.Error())
}
- got, err := repository.Get(context.Background(), id)
+ got, err := userRepository.Get(context.Background(), id)
if err != nil {
t.Fatalf("Error getting: %s", err.Error())
}
- want := &user.User{
+ want := &repository.User{
ID: id,
Username: "new_username",
Name: "new_name",
@@ -76,9 +76,9 @@ func TestUpdate(t *testing.T) {
db, tearDown := setup(t)
defer tearDown()
- repository := NewUserRepository(db)
+ userRepository := NewUserRepository(db)
- id, err := repository.Create(context.Background(), &user.CreateUser{
+ id, err := userRepository.Create(context.Background(), &repository.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(), id, &user.UpdateUser{
+ err = userRepository.Update(context.Background(), id, &repository.UpdateUser{
Username: "new_username",
Name: "new_name",
})
@@ -94,11 +94,11 @@ func TestUpdate(t *testing.T) {
t.Fatalf("Error update user: %s", err.Error())
}
- got, err := repository.Get(context.Background(), 1)
+ got, err := userRepository.Get(context.Background(), 1)
if err != nil {
t.Fatalf("Error getting user: %s", err.Error())
}
- want := &user.User{
+ want := &repository.User{
ID: id,
Username: "new_username",
Name: "new_name",