MCPcopy Create free account
hub / github.com/driangle/taskmd / TestHandleUpdateTask_EmptyID

Function TestHandleUpdateTask_EmptyID

apps/cli/internal/web/handlers_test.go:460–474  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

458}
459
460func TestHandleUpdateTask_EmptyID(t *testing.T) {
461 dir := createTestTaskDir(t)
462 dp := NewDataProvider(dir, false)
463
464 body := strings.NewReader(`{"status":"completed"}`)
465 req := httptest.NewRequest(http.MethodPut, "/api/tasks/", body)
466 // Don't set path value to simulate empty ID
467 rec := httptest.NewRecorder()
468
469 handleUpdateTask(dp, false)(rec, req)
470
471 if rec.Code != http.StatusBadRequest {
472 t.Fatalf("expected 400, got %d", rec.Code)
473 }
474}
475
476func TestHandleUpdateTask_NotFound(t *testing.T) {
477 dir := createTestTaskDir(t)

Callers

nothing calls this directly

Calls 3

createTestTaskDirFunction · 0.85
NewDataProviderFunction · 0.85
handleUpdateTaskFunction · 0.85

Tested by

no test coverage detected