--- Error paths (GET rejects + POST rejects consistently) ---
(t *testing.T)
| 351 | // --- Error paths (GET rejects + POST rejects consistently) --- |
| 352 | |
| 353 | func TestMagicLinkGETMissingToken(t *testing.T) { |
| 354 | server, _, _, smtpDone := setupMagicLinkAPI(t) |
| 355 | defer smtpDone() |
| 356 | |
| 357 | resp, _ := http.Get(server.URL + "/v1/approve") |
| 358 | defer resp.Body.Close() |
| 359 | if resp.StatusCode != http.StatusBadRequest { |
| 360 | t.Errorf("status = %d, want 400", resp.StatusCode) |
| 361 | } |
| 362 | } |
| 363 | |
| 364 | func TestMagicLinkPOSTMissingToken(t *testing.T) { |
| 365 | server, _, _, smtpDone := setupMagicLinkAPI(t) |
nothing calls this directly
no test coverage detected