Add delete endpoint
This commit is contained in:
@@ -156,6 +156,30 @@ func TestWho(t *testing.T) {
|
||||
b, _ = json.MarshalIndent(o, "", " ")
|
||||
t.Logf("POST POST:\n%s", b)
|
||||
})
|
||||
|
||||
t.Run("delete real", func(t *testing.T) {
|
||||
r := httptest.NewRequest(http.MethodDelete, "/who/col?id=NEWBIE"+want.Name, nil)
|
||||
w := httptest.NewRecorder()
|
||||
handler.ServeHTTP(w, r)
|
||||
if w.Code != http.StatusOK {
|
||||
t.Fatalf("%d: %s", w.Code, w.Body.Bytes())
|
||||
}
|
||||
r = httptest.NewRequest(http.MethodGet, "/who/col?id=NEWBIE"+want.Name, nil)
|
||||
w = httptest.NewRecorder()
|
||||
handler.ServeHTTP(w, r)
|
||||
if w.Code != http.StatusNotFound {
|
||||
t.Fatalf("%d: %s", w.Code, w.Body.Bytes())
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("delete fake", func(t *testing.T) {
|
||||
r := httptest.NewRequest(http.MethodDelete, "/who/col?id=FAKER"+want.Name, nil)
|
||||
w := httptest.NewRecorder()
|
||||
handler.ServeHTTP(w, r)
|
||||
if w.Code != http.StatusOK {
|
||||
t.Fatalf("%d: %s", w.Code, w.Body.Bytes())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func fillDB(t *testing.T, g storage.Graph) []entity.One {
|
||||
|
||||
Reference in New Issue
Block a user