Skip to content
Snippets Groups Projects
Commit b6dd9eca authored by Will McCutchen's avatar Will McCutchen
Browse files

Tests for /get should use correct response type

parent c2a9df3a
No related branches found
No related tags found
No related merge requests found
...@@ -95,7 +95,7 @@ func TestGet__Basic(t *testing.T) { ...@@ -95,7 +95,7 @@ func TestGet__Basic(t *testing.T) {
assertStatusCode(t, w, http.StatusOK) assertStatusCode(t, w, http.StatusOK)
assertContentType(t, w, jsonContentType) assertContentType(t, w, jsonContentType)
var resp *bodyResponse var resp *getResponse
err := json.Unmarshal(w.Body.Bytes(), &resp) err := json.Unmarshal(w.Body.Bytes(), &resp)
if err != nil { if err != nil {
t.Fatalf("failed to unmarshal body %s from JSON: %s", w.Body, err) t.Fatalf("failed to unmarshal body %s from JSON: %s", w.Body, err)
...@@ -138,7 +138,7 @@ func TestGet__WithParams(t *testing.T) { ...@@ -138,7 +138,7 @@ func TestGet__WithParams(t *testing.T) {
assertStatusCode(t, w, http.StatusOK) assertStatusCode(t, w, http.StatusOK)
assertContentType(t, w, jsonContentType) assertContentType(t, w, jsonContentType)
var resp *bodyResponse var resp *getResponse
err := json.Unmarshal(w.Body.Bytes(), &resp) err := json.Unmarshal(w.Body.Bytes(), &resp)
if err != nil { if err != nil {
t.Fatalf("failed to unmarshal body %s from JSON: %s", w.Body, err) t.Fatalf("failed to unmarshal body %s from JSON: %s", w.Body, err)
...@@ -228,7 +228,7 @@ func TestGet__XForwardedProto(t *testing.T) { ...@@ -228,7 +228,7 @@ func TestGet__XForwardedProto(t *testing.T) {
w := httptest.NewRecorder() w := httptest.NewRecorder()
handler.ServeHTTP(w, r) handler.ServeHTTP(w, r)
var resp *bodyResponse var resp *getResponse
err := json.Unmarshal(w.Body.Bytes(), &resp) err := json.Unmarshal(w.Body.Bytes(), &resp)
if err != nil { if err != nil {
t.Fatalf("failed to unmarshal body %s from JSON: %s", w.Body, err) t.Fatalf("failed to unmarshal body %s from JSON: %s", w.Body, err)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment