assertFileTooLarge checks the response indicates the file size was rejected.
(t *testing.T, res *httptest.ResponseRecorder)
| 101 | |
| 102 | // assertFileTooLarge checks the response indicates the file size was rejected. |
| 103 | func assertFileTooLarge(t *testing.T, res *httptest.ResponseRecorder) { |
| 104 | t.Helper() |
| 105 | if res.Code != http.StatusBadRequest || !strings.Contains(res.Body.String(), "File too large") { |
| 106 | t.Fatalf("expected 400 File too large, got %d: %s", res.Code, res.Body.String()) |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | // assertNotFileTooLarge checks the response was NOT rejected due to size. |
| 111 | func assertNotFileTooLarge(t *testing.T, res *httptest.ResponseRecorder) { |
no test coverage detected