From a669cf8d9364a02f3c4b774608a225a25590fd39 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 15 Jan 2015 17:01:07 -0900 Subject: [PATCH] Returning nil on delete, fix species test --- api/genera.go | 2 +- api/species.go | 2 +- models/species_test.go | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/genera.go b/api/genera.go index ded9823..ff10d43 100644 --- a/api/genera.go +++ b/api/genera.go @@ -90,5 +90,5 @@ func serveDeleteGenus(w http.ResponseWriter, r *http.Request) error { w.WriteHeader(http.StatusOK) } - return writeJSON(w, &models.Genus{}) + return writeJSON(w, nil) } diff --git a/api/species.go b/api/species.go index 4d16135..c91686b 100644 --- a/api/species.go +++ b/api/species.go @@ -88,7 +88,7 @@ func serveDeleteSpecies(w http.ResponseWriter, r *http.Request) error { w.WriteHeader(http.StatusOK) } - return writeJSON(w, &models.Species{}) + return writeJSON(w, nil) } func serveSubrouterSpeciesList(w http.ResponseWriter, r *http.Request) error { diff --git a/models/species_test.go b/models/species_test.go index 81bb84c..20f1f8a 100644 --- a/models/species_test.go +++ b/models/species_test.go @@ -156,6 +156,7 @@ func TestSpeciesService_Delete(t *testing.T) { mux.HandleFunc(urlPath(t, router.DeleteSpecies, map[string]string{"Id": "1"}), func(w http.ResponseWriter, r *http.Request) { called = true testMethod(t, r, "DELETE") + testBody(t, r, "") w.WriteHeader(http.StatusOK) writeJSON(w, want)