iris/_examples/request-body/read-params/main_test.go

17 lines
377 B
Go
Raw Normal View History

2020-08-31 19:30:01 +02:00
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"}}`
2023-07-08 01:08:18 +02:00
e.GET("/kataras/27/iris/web/framework").Expect().Status(httptest.StatusOK).Body().IsEqual(expectedBody)
2020-08-31 19:30:01 +02:00
}