mirror of
https://github.com/labstack/echo.git
synced 2025-04-23 12:18:53 +02:00
add unit-test
This commit is contained in:
parent
c4410fe0b8
commit
a973e3bc43
@ -1060,6 +1060,14 @@ func TestDefaultBinder_BindBody(t *testing.T) {
|
|||||||
expect: &Node{ID: 0, Node: ""},
|
expect: &Node{ID: 0, Node: ""},
|
||||||
expectError: "code=415, message=Unsupported Media Type",
|
expectError: "code=415, message=Unsupported Media Type",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "ok, JSON POST bind to struct with: path + query + http.NoBody",
|
||||||
|
givenURL: "/api/real_node/endpoint?node=xxx",
|
||||||
|
givenMethod: http.MethodPost,
|
||||||
|
givenContentType: MIMEApplicationJSON,
|
||||||
|
givenContent: http.NoBody,
|
||||||
|
expect: &Node{ID: 0, Node: ""},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user