refactor(server/api/test): withUser helper; migrate 51 context-value sites (A3)
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
func callRadio(h *handlers, user interface{}, query string) *httptest.ResponseRecorder {
|
||||
req := httptest.NewRequest(http.MethodGet, "/api/radio?"+query, nil)
|
||||
req = req.WithContext(context.WithValue(req.Context(), userCtxKeyForTest(), user))
|
||||
req = withUser(req, user)
|
||||
w := httptest.NewRecorder()
|
||||
h.handleRadio(w, req)
|
||||
return w
|
||||
|
||||
Reference in New Issue
Block a user