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

black-box the MakeHandler, works perfectly.

Former-commit-id: d325be0e953efc2f841c69f62233b34d4a58ab62
This commit is contained in:
kataras
2017-11-24 15:10:30 +02:00
parent bfec1d174f
commit 29835d9a8e
5 changed files with 126 additions and 51 deletions

View File

@@ -1,30 +0,0 @@
package mvc2_test
import (
"testing"
"github.com/kataras/iris"
"github.com/kataras/iris/httptest"
"github.com/kataras/iris/mvc2"
)
var (
lowLevelHandler = func(ctx iris.Context) {
ctx.Writef("low-level handler")
}
)
func TestHandler(t *testing.T) {
app := iris.New()
m := mvc2.New()
// should just return a context.Handler
// without performance penalties.
app.Get("/", m.Handler(lowLevelHandler))
e := httptest.New(t, app, httptest.LogLevel("debug"))
// 1
e.GET("/").Expect().Status(httptest.StatusOK).
Body().Equal("low-level handler")
}