mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +02:00
Merge pull request #1558 from iwamot/testafter
Add test for 'func (*Response) After'
This commit is contained in:
commit
7533c6984b
@ -19,8 +19,13 @@ func TestResponse(t *testing.T) {
|
||||
res.Before(func() {
|
||||
c.Response().Header().Set(HeaderServer, "echo")
|
||||
})
|
||||
// After
|
||||
res.After(func() {
|
||||
c.Response().Header().Set(HeaderXFrameOptions, "DENY")
|
||||
})
|
||||
res.Write([]byte("test"))
|
||||
assert.Equal(t, "echo", rec.Header().Get(HeaderServer))
|
||||
assert.Equal(t, "DENY", rec.Header().Get(HeaderXFrameOptions))
|
||||
}
|
||||
|
||||
func TestResponse_Write_FallsBackToDefaultStatus(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user