Skip to content

Commit

Permalink
try fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeweb committed Dec 5, 2016
1 parent e634832 commit a6becd4
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions controllers/tables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,26 @@ func TestDeleteFromTable(t *testing.T) {
})
}

func TestDeleteFromTable(t *testing.T) {
func TestUpdateFromTable(t *testing.T) {
router := mux.NewRouter()
r.HandleFunc("/{database}/{schema}/{table}", UpdateTable).Methods("PUT", "PATCH")
router.HandleFunc("/{database}/{schema}/{table}", UpdateTable).Methods("PUT", "PATCH")
server := httptest.NewServer(router)
defer server.Close()
r := api.Request{
Data: map[string]string{
"name": "prest",
},
}
Convey("excute update in a table without where clause using PUT", t, func() {
doValidPutRequest(server.URL + "/prest/public/test")
doValidPutRequest(server.URL+"/prest/public/test", r)
})
Convey("excute update in a table with where clause using PUT", t, func() {
doValidPutRequest(server.URL + "/prest/public/test?name=nuveo")
doValidPutRequest(server.URL+"/prest/public/test?name=nuveo", r)
})
Convey("excute update in a table without where clause using PATCH", t, func() {
doValidPatchRequest(server.URL + "/prest/public/test")
doValidPatchRequest(server.URL+"/prest/public/test", r)
})
Convey("excute update in a table with where clause using PATCH", t, func() {
doValidPatchRequest(server.URL + "/prest/public/test?name=nuveo")
doValidPatchRequest(server.URL+"/prest/public/test?name=nuveo", r)
})
}

0 comments on commit a6becd4

Please sign in to comment.