1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 09:57:01 +00:00
Files
kararas_iris/_examples/routing/route-register-rule/main_test.go
Gerasimos (Makis) Maropoulos ffc493a0b9 add authenticated-controller example - proof of concept
Former-commit-id: 7a15da2bd966f2a699337cd494af8b5d1877b11d
2020-05-06 04:45:12 +03:00

23 lines
545 B
Go

package main
import (
"testing"
"github.com/kataras/iris/v12/core/router"
"github.com/kataras/iris/v12/httptest"
)
func TestRouteRegisterRuleExample(t *testing.T) {
app := newApp()
e := httptest.New(t, app)
for _, method := range router.AllMethods {
tt := e.Request(method, "/").Expect().Status(httptest.StatusOK).Body()
if method == "GET" {
tt.Equal("From GET: iris/_examples/routing/route-register-rule.getHandler")
} else {
tt.Equal("From " + method + ": iris/_examples/routing/route-register-rule.anyHandler")
}
}
}