summaryrefslogtreecommitdiff
path: root/app/controllers/sparkles
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-30 10:15:17 -0600
committermo khan <mo@mokhan.ca>2025-07-30 10:15:17 -0600
commitf39fe4ef183164af559768e09ff3388f3617997c (patch)
tree2ddb050d2ead1d88d6a59e6b975f688c3d213b6a /app/controllers/sparkles
parenta9a093fcc7a4e0c65f363eb2e2439631062de645 (diff)
refactor: extract a separate repository to publish events
Diffstat (limited to 'app/controllers/sparkles')
-rw-r--r--app/controllers/sparkles/controller_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/sparkles/controller_test.go b/app/controllers/sparkles/controller_test.go
index 5c37a11..71e1d96 100644
--- a/app/controllers/sparkles/controller_test.go
+++ b/app/controllers/sparkles/controller_test.go
@@ -8,7 +8,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- "github.com/xlgmokha/x/pkg/event"
"github.com/xlgmokha/x/pkg/serde"
"github.com/xlgmokha/x/pkg/test"
"github.com/xlgmokha/x/pkg/x"
@@ -37,7 +36,7 @@ func (f *FailingResponseWriter) Write([]byte) (int, error) {
func TestSparkles(t *testing.T) {
t.Run("GET /sparkles", func(t *testing.T) {
sparkle := x.New[*domain.Sparkle](domain.WithText("@tanuki for helping me"))
- store := db.NewRepository[*domain.Sparkle](event.New[*domain.Sparkle]())
+ store := db.NewRepository[*domain.Sparkle]()
store.Save(t.Context(), sparkle)
mux := http.NewServeMux()
@@ -66,7 +65,7 @@ func TestSparkles(t *testing.T) {
t.Run("POST /sparkles", func(t *testing.T) {
t.Run("when a user is authenticated", func(t *testing.T) {
currentUser := x.New[*domain.User](domain.WithID[*domain.User](domain.ID("1")))
- repository := db.NewRepository[*domain.Sparkle](event.New[*domain.Sparkle]())
+ repository := db.NewRepository[*domain.Sparkle]()
t.Run("when the user is authorized", func(t *testing.T) {
mux := http.NewServeMux()