Skip to content

Commit

Permalink
Change tests for getRequestId to validate against passed value
Browse files Browse the repository at this point in the history
  • Loading branch information
Héctor Hurtado committed Sep 10, 2020
1 parent 66b227e commit 9a78bdd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/server/data/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ func TestGetRouteIdSetsOctectStreamContentType(t *testing.T) {
}
}

func TestGetRouteIdReturnsTheCorrectMethod(t *testing.T) {
func TestGetRouteIdReturnsTheCorrectRouteId(t *testing.T) {
h := model.Handler{
Request: httptest.NewRequest("FOO", "/", nil),
Writer: httptest.NewRecorder(),
Expand All @@ -1183,8 +1183,8 @@ func TestGetRouteIdReturnsTheCorrectMethod(t *testing.T) {
getRequestId(w, r, &h)

res := w.Result()
if body, _ := ioutil.ReadAll(res.Body); string(body) != "Expected_ID" {
t.Errorf("Body mismatch. Expected: %q, got: %q", "Expected_ID", string(body))
if body, _ := ioutil.ReadAll(res.Body); string(body) != h.Route.ID {
t.Errorf("Body mismatch. Expected: %q, got: %q", h.Route.ID, string(body))
}
}

Expand Down

0 comments on commit 9a78bdd

Please sign in to comment.