1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-19 19:07:06 +00:00

Update to 3.0.0-rc.1 - Read the HISTORY.md. Relative: #183 #184 #166 #176 #181

Read https://github.com/kataras/iris/tree/master/HISTORY.md
This commit is contained in:
Makis Maropoulos
2016-06-14 08:45:40 +03:00
parent 2da67206c8
commit d837381b16
59 changed files with 3972 additions and 4927 deletions

View File

@@ -6,7 +6,6 @@ import (
"github.com/gavv/httpexpect"
"github.com/gavv/httpexpect/fasthttpexpect"
"github.com/kataras/iris"
"github.com/kataras/iris/config"
)
var notFoundMessage = "Iris custom message for 404 not found"
@@ -46,15 +45,7 @@ func TestCustomErrors(t *testing.T) {
}
}
api.PreListen(config.Server{ListeningAddr: ""})
// create httpexpect instance that will call fasthtpp.RequestHandler directly
e := httpexpect.WithConfig(httpexpect.Config{
Reporter: httpexpect.NewAssertReporter(t),
Client: fasthttpexpect.NewBinder(api.ServeRequest),
})
// first register the custom errors
// register the custom errors
api.OnError(404, func(ctx *iris.Context) {
ctx.Write("%s", notFoundMessage)
})
@@ -63,6 +54,12 @@ func TestCustomErrors(t *testing.T) {
ctx.Write("%s", internalServerMessage)
})
// create httpexpect instance that will call fasthtpp.RequestHandler directly
e := httpexpect.WithConfig(httpexpect.Config{
Reporter: httpexpect.NewAssertReporter(t),
Client: fasthttpexpect.NewBinder(api.NoListen().Handler),
})
// run the tests
for _, r := range routesCustomErrors {
e.Request(r.Method, r.RequestPath).