To gitea and beyond, let's go(-yco)

This commit is contained in:
2025-11-10 19:12:09 +01:00
parent 8f6133392d
commit 71a031342b
245 changed files with 83994 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package testutils
import (
"fmt"
"testing"
"goyco/internal/database"
"goyco/internal/repositories"
)
func CreatePostWithRepo(t *testing.T, repo repositories.PostRepository, authorID uint, title, url string) *database.Post {
t.Helper()
post := &database.Post{
Title: title,
URL: url,
Content: fmt.Sprintf("Content for %s", title),
AuthorID: &authorID,
}
if err := repo.Create(post); err != nil {
t.Fatalf("Failed to create test post: %v", err)
}
return post
}