Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
EC2 Default User committed Dec 21, 2020
1 parent 5bfefcc commit 68e8a94
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/internal/handler/route/route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,8 @@ func TestRoute(t *testing.T) {
time.Sleep(time.Duration(100) * time.Millisecond)

// check ID discrepancy on Update

// test the string body id value != string route id value
errRoute := &UpdateInput{}
errRoute.ID = "2"
err = json.Unmarshal([]byte(reqBody), errRoute)
Expand All @@ -768,7 +770,7 @@ func TestRoute(t *testing.T) {
assert.EqualError(t, err, "ID on path (2) doesn't match ID on body (1)")
assert.Equal(t, http.StatusBadRequest, ret.(*data.SpecCodeResponse).StatusCode)

// tests that float body id can be supported
// tests the float body id value != string route id value
reqBodyErr := `{
"id": 1,
"uri": "/index.html",
Expand All @@ -791,7 +793,7 @@ func TestRoute(t *testing.T) {
assert.EqualError(t, err, "ID on path (2) doesn't match ID on body (1)")
assert.Equal(t, http.StatusBadRequest, ret.(*data.SpecCodeResponse).StatusCode)

// tests the float body id value
// tests the float body id value is == string route id value
errRoute = &UpdateInput{}
errRoute.ID = "1"
err = json.Unmarshal([]byte(reqBodyErr), errRoute)
Expand Down

0 comments on commit 68e8a94

Please sign in to comment.