| 164 | } |
| 165 | |
| 166 | func TestFeedback_DefaultCategory(t *testing.T) { |
| 167 | server, _, _ := setupAPI(t) |
| 168 | |
| 169 | // No category provided — should default to "general" and succeed |
| 170 | payload := `{"message":"just a thought"}` |
| 171 | resp, _ := http.Post(server.URL+"/api/feedback", "application/json", bytes.NewBufferString(payload)) |
| 172 | defer resp.Body.Close() |
| 173 | |
| 174 | if resp.StatusCode != 200 { |
| 175 | t.Errorf("status = %d, want 200 (default category)", resp.StatusCode) |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | func TestFeedback_AllCategories(t *testing.T) { |
| 180 | server, _, _ := setupAPI(t) |