mirror of
https://github.com/labstack/echo.git
synced 2025-07-15 01:34:53 +02:00
Add test case for Response (#1557)
This commit is contained in:
@ -41,3 +41,13 @@ func TestResponse_Write_UsesSetResponseCode(t *testing.T) {
|
||||
res.Write([]byte("test"))
|
||||
assert.Equal(t, http.StatusBadRequest, rec.Code)
|
||||
}
|
||||
|
||||
func TestResponse_Flush(t *testing.T) {
|
||||
e := New()
|
||||
rec := httptest.NewRecorder()
|
||||
res := &Response{echo: e, Writer: rec}
|
||||
|
||||
res.Write([]byte("test"))
|
||||
res.Flush()
|
||||
assert.True(t, rec.Flushed)
|
||||
}
|
||||
|
Reference in New Issue
Block a user