(t *testing.T)
| 152 | } |
| 153 | |
| 154 | func TestFeedback_InvalidCategory(t *testing.T) { |
| 155 | server, _, _ := setupAPI(t) |
| 156 | |
| 157 | payload := `{"message":"hello","category":"invalid"}` |
| 158 | resp, _ := http.Post(server.URL+"/api/feedback", "application/json", bytes.NewBufferString(payload)) |
| 159 | defer resp.Body.Close() |
| 160 | |
| 161 | if resp.StatusCode != 400 { |
| 162 | t.Errorf("status = %d, want 400 for invalid category", resp.StatusCode) |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | func TestFeedback_DefaultCategory(t *testing.T) { |
| 167 | server, _, _ := setupAPI(t) |