MCPcopy Index your code
hub / github.com/devaccuracy/ledgerforge / TestUpdateHook

Function TestUpdateHook

api/hooks_test.go:61–74  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

59}
60
61func TestUpdateHook(t *testing.T) {
62 router, _, err := setupRouter(t)
63 if err != nil {
64 t.Fatalf("Failed to setup router: %v", err)
65 }
66
67 t.Run("Invalid JSON", func(t *testing.T) {
68 req := httptest.NewRequest("PUT", "/hooks/hk_test123", bytes.NewReader([]byte("invalid json")))
69 req.Header.Set("Content-Type", "application/json")
70 resp := httptest.NewRecorder()
71 router.ServeHTTP(resp, req)
72 assert.Equal(t, http.StatusBadRequest, resp.Code)
73 })
74}
75
76func TestGetHook(t *testing.T) {
77 router, _, err := setupRouter(t)

Callers

nothing calls this directly

Calls 2

setupRouterFunction · 0.85
SetMethod · 0.65

Tested by

no test coverage detected