1
0
mirror of https://github.com/labstack/echo.git synced 2025-06-19 00:27:34 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2019-06-27 10:52:17 -07:00
parent 858270f6f5
commit 8fb7b5be27
3 changed files with 11 additions and 12 deletions

View File

@ -788,15 +788,10 @@ func TestContext_Bind(t *testing.T) {
e := New()
req := httptest.NewRequest(POST, "/", strings.NewReader(userJSON))
c := e.NewContext(req, nil)
var u *user
err := c.Bind(u)
testify.Error(t, err)
testify.Nil(t, u)
u := new(user)
req.Header.Add(HeaderContentType, MIMEApplicationJSON)
err = c.Bind(&u)
err := c.Bind(u)
testify.NoError(t, err)
testify.Equal(t, &user{1, "Jon Snow"}, u)
}