Genus changes for ember data.
This commit is contained in:
parent
8a72ecae69
commit
8052ab425c
3 changed files with 25 additions and 16 deletions
|
@ -25,7 +25,7 @@ func TestGeneraService_Get(t *testing.T) {
|
|||
called = true
|
||||
testMethod(t, r, "GET")
|
||||
|
||||
writeJSON(w, want)
|
||||
writeJSON(w, GenusJSON{Genus: want})
|
||||
})
|
||||
|
||||
genus, err := client.Genera.Get(want.Id)
|
||||
|
@ -54,7 +54,7 @@ func TestGeneraService_Create(t *testing.T) {
|
|||
mux.HandleFunc(urlPath(t, router.CreateGenus, nil), func(w http.ResponseWriter, r *http.Request) {
|
||||
called = true
|
||||
testMethod(t, r, "POST")
|
||||
testBody(t, r, `{"id":1,"genusName":"Test Genus","createdAt":"0001-01-01T00:00:00Z","updatedAt":"0001-01-01T00:00:00Z","deletedAt":null}`+"\n")
|
||||
testBody(t, r, `{"genus":{"id":1,"genusName":"Test Genus","createdAt":"0001-01-01T00:00:00Z","updatedAt":"0001-01-01T00:00:00Z","deletedAt":null}}`+"\n")
|
||||
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
writeJSON(w, want)
|
||||
|
@ -93,7 +93,7 @@ func TestGeneraService_List(t *testing.T) {
|
|||
testMethod(t, r, "GET")
|
||||
testFormValues(t, r, values{})
|
||||
|
||||
writeJSON(w, want)
|
||||
writeJSON(w, GeneraJSON{Genera: want})
|
||||
})
|
||||
|
||||
genera, err := client.Genera.List(nil)
|
||||
|
@ -124,7 +124,7 @@ func TestGeneraService_Update(t *testing.T) {
|
|||
mux.HandleFunc(urlPath(t, router.UpdateGenus, map[string]string{"Id": "1"}), func(w http.ResponseWriter, r *http.Request) {
|
||||
called = true
|
||||
testMethod(t, r, "PUT")
|
||||
testBody(t, r, `{"id":1,"genusName":"Test Genus Updated","createdAt":"0001-01-01T00:00:00Z","updatedAt":"0001-01-01T00:00:00Z","deletedAt":null}`+"\n")
|
||||
testBody(t, r, `{"genus":{"id":1,"genusName":"Test Genus Updated","createdAt":"0001-01-01T00:00:00Z","updatedAt":"0001-01-01T00:00:00Z","deletedAt":null}}`+"\n")
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
writeJSON(w, want)
|
||||
|
@ -156,6 +156,7 @@ func TestGeneraService_Delete(t *testing.T) {
|
|||
mux.HandleFunc(urlPath(t, router.DeleteGenus, 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)
|
||||
|
|
Reference in a new issue