Use Header() instead of deprecated HeaderMap

`HeaderMap` is deprecated and should avoid to use.
Ref: https://golang.org/pkg/net/http/httptest/#ResponseRecorder
This commit is contained in:
yuuji.yaginuma 2021-04-17 14:27:22 +09:00
parent ee4de846a8
commit 2bb70315d3

View File

@ -1044,7 +1044,7 @@ func TestContextRenderAttachment(t *testing.T) {
assert.Equal(t, 200, w.Code)
assert.Contains(t, w.Body.String(), "func New() *Engine {")
assert.Equal(t, fmt.Sprintf("attachment; filename=\"%s\"", newFilename), w.HeaderMap.Get("Content-Disposition"))
assert.Equal(t, fmt.Sprintf("attachment; filename=\"%s\"", newFilename), w.Header().Get("Content-Disposition"))
}
// TestContextRenderYAML tests that the response is serialized as YAML