A few big changes
- Adding timezone to source config - genera: update record (missed a few pieces) - genera: delete record
This commit is contained in:
parent
33194ffd2f
commit
279651930e
12 changed files with 203 additions and 4 deletions
|
@ -136,3 +136,32 @@ func TestGeneraService_Update(t *testing.T) {
|
|||
t.Fatal("!called")
|
||||
}
|
||||
}
|
||||
|
||||
func TestGeneraService_Delete(t *testing.T) {
|
||||
setup()
|
||||
defer teardown()
|
||||
|
||||
want := &Genus{Id: 1, GenusName: "Test Genus"}
|
||||
|
||||
var called bool
|
||||
mux.HandleFunc(urlPath(t, router.DeleteGenus, map[string]string{"Id": "1"}), func(w http.ResponseWriter, r *http.Request) {
|
||||
called = true
|
||||
testMethod(t, r, "DELETE")
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
writeJSON(w, want)
|
||||
})
|
||||
|
||||
deleted, err := client.Genera.Delete(1)
|
||||
if err != nil {
|
||||
t.Errorf("Genera.Delete returned error: %v", err)
|
||||
}
|
||||
|
||||
if !deleted {
|
||||
t.Error("!deleted")
|
||||
}
|
||||
|
||||
if !called {
|
||||
t.Fatal("!called")
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue