iris/_examples/request-body/read-params/main_test.go
Gerasimos (Makis) Maropoulos 477f5e6f9b
add Context.ReadParams method
2020-08-31 20:30:01 +03:00

17 lines
375 B
Go

package main
import (
"testing"
"github.com/kataras/iris/v12/httptest"
)
func TestReadParams(t *testing.T) {
app := newApp()
e := httptest.New(t, app)
expectedBody := `myParams: main.myParams{Name:"kataras", Age:27, Tail:[]string{"iris", "web", "framework"}}`
e.GET("/kataras/27/iris/web/framework").Expect().Status(httptest.StatusOK).Body().Equal(expectedBody)
}