1
0
mirror of https://github.com/kataras/iris.git synced 2026-03-08 01:16:30 +00:00

add some tests for the content type for the embedding files and gziped embedded files

Former-commit-id: b7fe470f33efcdf70df3e41ad880bbd4704cbb4a
This commit is contained in:
Gerasimos Maropoulos
2018-03-15 23:09:07 +02:00
parent 2d8652d7fb
commit 89022c7051
3 changed files with 50 additions and 0 deletions

View File

@@ -12,6 +12,17 @@ import (
type resource string
func (r resource) contentType() string {
switch filepath.Ext(r.String()) {
case ".js":
return "application/javascript"
case ".css":
return "text/css"
default:
return "text/html"
}
}
func (r resource) String() string {
return string(r)
}
@@ -59,6 +70,7 @@ func TestSPAEmbedded(t *testing.T) {
e.GET(url).Expect().
Status(httptest.StatusOK).
ContentType(u.contentType(), app.ConfigurationReadOnly().GetCharset()).
Body().Equal(contents)
}
}