Fix typo getRequestId -> getRouteId
This commit is contained in:
@@ -161,7 +161,7 @@ func getRequestFileContent(w http.ResponseWriter, r *http.Request, h *model.Hand
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func getRequestId(w http.ResponseWriter, r *http.Request, h *model.Handler) {
|
func getRouteId(w http.ResponseWriter, r *http.Request, h *model.Handler) {
|
||||||
w.Header().Add("Content-Type", "application/octet-stream")
|
w.Header().Add("Content-Type", "application/octet-stream")
|
||||||
_, _ = w.Write([]byte(h.Route.ID))
|
_, _ = w.Write([]byte(h.Route.ID))
|
||||||
|
|
||||||
|
|||||||
@@ -1147,7 +1147,7 @@ func TestGetRouteId200sOnHappyPath(t *testing.T) {
|
|||||||
r := httptest.NewRequest("GET", "/not-important-here", nil)
|
r := httptest.NewRequest("GET", "/not-important-here", nil)
|
||||||
w := httptest.NewRecorder()
|
w := httptest.NewRecorder()
|
||||||
|
|
||||||
getRequestId(w, r, &h)
|
getRouteId(w, r, &h)
|
||||||
|
|
||||||
res := w.Result()
|
res := w.Result()
|
||||||
if res.StatusCode != http.StatusOK {
|
if res.StatusCode != http.StatusOK {
|
||||||
@@ -1163,7 +1163,7 @@ func TestGetRouteIdSetsOctectStreamContentType(t *testing.T) {
|
|||||||
r := httptest.NewRequest("GET", "/not-important-here", nil)
|
r := httptest.NewRequest("GET", "/not-important-here", nil)
|
||||||
w := httptest.NewRecorder()
|
w := httptest.NewRecorder()
|
||||||
|
|
||||||
getRequestId(w, r, &h)
|
getRouteId(w, r, &h)
|
||||||
|
|
||||||
res := w.Result()
|
res := w.Result()
|
||||||
if v := res.Header.Get("Content-Type"); v != "application/octet-stream" {
|
if v := res.Header.Get("Content-Type"); v != "application/octet-stream" {
|
||||||
@@ -1180,7 +1180,7 @@ func TestGetRouteIdReturnsTheCorrectRouteId(t *testing.T) {
|
|||||||
r := httptest.NewRequest("GET", "/not-important-here", nil)
|
r := httptest.NewRequest("GET", "/not-important-here", nil)
|
||||||
w := httptest.NewRecorder()
|
w := httptest.NewRecorder()
|
||||||
|
|
||||||
getRequestId(w, r, &h)
|
getRouteId(w, r, &h)
|
||||||
|
|
||||||
res := w.Result()
|
res := w.Result()
|
||||||
if body, _ := ioutil.ReadAll(res.Body); string(body) != h.Route.ID {
|
if body, _ := ioutil.ReadAll(res.Body); string(body) != h.Route.ID {
|
||||||
|
|||||||
Reference in New Issue
Block a user