(t *testing.T)
| 190 | } |
| 191 | |
| 192 | func TestHookRunsHandlerRejectsMissingSession(t *testing.T) { |
| 193 | t.Parallel() |
| 194 | |
| 195 | engine := newTestRouter(t, newTestHandlers(t, stubSessionManager{}, stubObserver{}, newTestHomePaths(t))) |
| 196 | recorder := performRequest(t, engine, http.MethodGet, "/api/workspaces/ws-workspace/hooks/runs", nil) |
| 197 | if recorder.Code != http.StatusBadRequest { |
| 198 | t.Fatalf("status = %d, want %d; body=%s", recorder.Code, http.StatusBadRequest, recorder.Body.String()) |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | func TestHookRunsHandlerRejectsForeignWorkspaceSession(t *testing.T) { |
| 203 | t.Parallel() |
nothing calls this directly
no test coverage detected