From e9546b40c8befabda26c1598c124a6ee2a8d2b8f Mon Sep 17 00:00:00 2001 From: mo khan Date: Wed, 28 May 2025 14:26:19 -0600 Subject: refactor: always provide a user in the request context --- app/controllers/dashboard/controller_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/controllers/dashboard/controller_test.go') diff --git a/app/controllers/dashboard/controller_test.go b/app/controllers/dashboard/controller_test.go index c717a74..ddbfd34 100644 --- a/app/controllers/dashboard/controller_test.go +++ b/app/controllers/dashboard/controller_test.go @@ -28,7 +28,7 @@ func TestController(t *testing.T) { }) t.Run("when authenticated", func(t *testing.T) { - ctx := cfg.CurrentUser.With(t.Context(), &domain.User{}) + ctx := cfg.CurrentUser.With(t.Context(), &domain.User{ID: domain.ID("1")}) r, w := test.RequestResponse("GET", "/dashboard", test.WithContext(ctx)) mux.ServeHTTP(w, r) @@ -55,6 +55,7 @@ func TestController(t *testing.T) { t.Run("when authenticated", func(t *testing.T) { ctx := cfg.CurrentUser.With(t.Context(), &domain.User{ + ID: domain.ID("1"), Username: "root", }) r, w := test.RequestResponse("GET", "/dashboard/nav", test.WithContext(ctx)) -- cgit v1.2.3