From 9a78bddcc47ecf39b74fd60b895231d0062ca78c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Hurtado?= Date: Thu, 10 Sep 2020 12:41:04 +0200 Subject: [PATCH] Change tests for getRequestId to validate against passed value --- internal/server/data/resource_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/server/data/resource_test.go b/internal/server/data/resource_test.go index fb140df..e8a27c3 100644 --- a/internal/server/data/resource_test.go +++ b/internal/server/data/resource_test.go @@ -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(), @@ -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)) } }