Skip to content

Commit

Permalink
Merge pull request #6 from eloyekunle/master
Browse files Browse the repository at this point in the history
Replaced deprecated res.HeaderMap with res.Header()
  • Loading branch information
thedevsaddam authored Nov 10, 2018
2 parents a01ea90 + 4807d1e commit ab8680e
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions renderer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func Test_Render(t *testing.T) {

checkNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), ContentJSON)
checkContentType(t, res.Header().Get(ContentType), ContentJSON)
checkBody(t, res.Body.String(), expected)
}

Expand All @@ -172,7 +172,7 @@ func Test_String(t *testing.T) {

checkNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), ContentText+"; charset="+defaultCharSet)
checkContentType(t, res.Header().Get(ContentType), ContentText+"; charset="+defaultCharSet)
checkBody(t, res.Body.String(), expected)
}

Expand Down Expand Up @@ -234,7 +234,7 @@ func Test_JSON_prefix(t *testing.T) {

checkNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), ContentJSON+"; charset="+defaultCharSet)
checkContentType(t, res.Header().Get(ContentType), ContentJSON+"; charset="+defaultCharSet)
checkBody(t, res.Body.String(), expected)
}

Expand All @@ -259,7 +259,7 @@ func Test_JSONP(t *testing.T) {

checkNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), ContentJSONP+"; charset="+defaultCharSet)
checkContentType(t, res.Header().Get(ContentType), ContentJSONP+"; charset="+defaultCharSet)
checkBody(t, res.Body.String(), expected)
}

Expand All @@ -283,7 +283,7 @@ func Test_JSONP_without_callback(t *testing.T) {

checkNotNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), ContentJSONP+"; charset="+defaultCharSet)
checkContentType(t, res.Header().Get(ContentType), ContentJSONP+"; charset="+defaultCharSet)
}

func Test_XML(t *testing.T) {
Expand All @@ -303,7 +303,7 @@ func Test_XML(t *testing.T) {

checkNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), ContentXML+"; charset="+defaultCharSet)
checkContentType(t, res.Header().Get(ContentType), ContentXML+"; charset="+defaultCharSet)
checkBody(t, res.Body.String(), expected)
}

Expand All @@ -329,7 +329,7 @@ func Test_XML_indent_prefix(t *testing.T) {

checkNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), ContentXML+"; charset="+defaultCharSet)
checkContentType(t, res.Header().Get(ContentType), ContentXML+"; charset="+defaultCharSet)
checkBody(t, res.Body.String(), expected)
}

Expand All @@ -350,7 +350,7 @@ func Test_YAML(t *testing.T) {

checkNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), ContentYAML+"; charset="+defaultCharSet)
checkContentType(t, res.Header().Get(ContentType), ContentYAML+"; charset="+defaultCharSet)
checkBody(t, res.Body.String(), expected)
}

Expand All @@ -371,7 +371,7 @@ func Test_HTMLString(t *testing.T) {

checkNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), ContentHTML+"; charset="+defaultCharSet)
checkContentType(t, res.Header().Get(ContentType), ContentHTML+"; charset="+defaultCharSet)
checkBody(t, res.Body.String(), expected)
}

Expand Down Expand Up @@ -406,7 +406,7 @@ func Test_HTML(t *testing.T) {

checkNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), ContentHTML+"; charset="+defaultCharSet)
checkContentType(t, res.Header().Get(ContentType), ContentHTML+"; charset="+defaultCharSet)
checkBody(t, res.Body.String(), expected)
}

Expand Down Expand Up @@ -440,7 +440,7 @@ func Test_HTML_without_name_and_debug(t *testing.T) {

checkNotNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), ContentHTML+"; charset="+defaultCharSet)
checkContentType(t, res.Header().Get(ContentType), ContentHTML+"; charset="+defaultCharSet)
}

func Test_HTML_invalid_name(t *testing.T) {
Expand Down Expand Up @@ -473,7 +473,7 @@ func Test_HTML_invalid_name(t *testing.T) {

checkNotNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), ContentHTML+"; charset="+defaultCharSet)
checkContentType(t, res.Header().Get(ContentType), ContentHTML+"; charset="+defaultCharSet)
}

func Test_Template(t *testing.T) {
Expand Down Expand Up @@ -510,7 +510,7 @@ func Test_Template(t *testing.T) {

checkNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), ContentHTML+"; charset="+defaultCharSet)
checkContentType(t, res.Header().Get(ContentType), ContentHTML+"; charset="+defaultCharSet)
checkBody(t, res.Body.String(), expected)
}

Expand Down Expand Up @@ -549,7 +549,7 @@ func Test_View(t *testing.T) {

checkNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), ContentHTML+"; charset="+defaultCharSet)
checkContentType(t, res.Header().Get(ContentType), ContentHTML+"; charset="+defaultCharSet)
checkBody(t, res.Body.String(), expected)
}

Expand Down Expand Up @@ -584,7 +584,7 @@ func Test_View_invalid_name(t *testing.T) {

checkNotNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), ContentHTML+"; charset="+defaultCharSet)
checkContentType(t, res.Header().Get(ContentType), ContentHTML+"; charset="+defaultCharSet)
}

func Test_Binary_inline(t *testing.T) {
Expand All @@ -602,7 +602,7 @@ func Test_Binary_inline(t *testing.T) {

checkNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), r.opts.ContentBinary)
checkContentType(t, res.Header().Get(ContentType), r.opts.ContentBinary)
checkBody(t, res.Body.String(), "This is a long binary data")
}

Expand All @@ -621,7 +621,7 @@ func Test_Binary_attachment(t *testing.T) {

checkNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), r.opts.ContentBinary)
checkContentType(t, res.Header().Get(ContentType), r.opts.ContentBinary)
checkBody(t, res.Body.String(), "This is a long binary data")
}

Expand Down Expand Up @@ -675,7 +675,7 @@ func Test_File_view(t *testing.T) {

checkNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), r.opts.ContentText)
checkContentType(t, res.Header().Get(ContentType), r.opts.ContentText)
}

func Test_File_download(t *testing.T) {
Expand All @@ -692,7 +692,7 @@ func Test_File_download(t *testing.T) {

checkNil(t, err)
checkStatusOK(t, res.Code)
checkContentType(t, res.HeaderMap.Get(ContentType), r.opts.ContentText)
checkContentType(t, res.Header().Get(ContentType), r.opts.ContentText)
}

func Benchmark_NoContent(b *testing.B) {
Expand Down

0 comments on commit ab8680e

Please sign in to comment.