| 204 | } |
| 205 | |
| 206 | func TestFeedback_MessageTooLong(t *testing.T) { |
| 207 | server, _, _ := setupAPI(t) |
| 208 | |
| 209 | msg := bytes.Repeat([]byte("a"), 5001) |
| 210 | payload := fmt.Sprintf(`{"message":"%s"}`, string(msg)) |
| 211 | resp, _ := http.Post(server.URL+"/api/feedback", "application/json", bytes.NewBufferString(payload)) |
| 212 | defer resp.Body.Close() |
| 213 | |
| 214 | if resp.StatusCode != 400 { |
| 215 | t.Errorf("status = %d, want 400 for message too long", resp.StatusCode) |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | func TestFeedback_RateLimit(t *testing.T) { |
| 220 | server, _, _ := setupAPI(t) |