Files
pulse-api/internal/handler/profile_test.go
2026-03-26 19:03:22 +00:00

21 lines
399 B
Go

package handler
import (
"bytes"
"net/http"
"net/http/httptest"
"testing"
)
func TestProfileHandler_Update_InvalidBody(t *testing.T) {
req := httptest.NewRequest("PUT", "/profile", bytes.NewBufferString("not json"))
rr := httptest.NewRecorder()
h := &ProfileHandler{userRepo: nil}
h.Update(rr, req)
if rr.Code != http.StatusBadRequest {
t.Errorf("expected 400, got %d", rr.Code)
}
}