refactor(server/api/test): withUser helper; migrate 51 context-value sites (A3)

This commit is contained in:
2026-05-08 10:39:11 -04:00
parent bf90a3a868
commit c81491164a
11 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ func TestHandleGetMe_ReturnsAuthenticatedUser(t *testing.T) {
user := seedUser(t, pool, "alice", "hunter2", true)
req := httptest.NewRequest(http.MethodGet, "/api/me", nil)
req = req.WithContext(context.WithValue(req.Context(), userCtxKeyForTest(), user))
req = withUser(req, user)
w := httptest.NewRecorder()
h.handleGetMe(w, req)