Adjust current implementation to accomodate content-type and test to check it
This commit is contained in:
@@ -6,5 +6,5 @@ import (
|
|||||||
|
|
||||||
func RemoveRoute(host, id string) error {
|
func RemoveRoute(host, id string) error {
|
||||||
url := host + "/routes/" + id
|
url := host + "/routes/" + id
|
||||||
return http.Delete(url, nil, nil)
|
return http.Delete(url, "application/json", nil, nil)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ func TestRemoveRouteExistent(t *testing.T) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
defer gock.Off()
|
defer gock.Off()
|
||||||
gock.New(host).Delete("/routes/" + routeID).Reply(http.StatusNoContent)
|
gock.New(host).Delete("/routes/" + routeID).MatchType("json").Reply(http.StatusNoContent)
|
||||||
|
|
||||||
err := RemoveRoute(host, routeID)
|
err := RemoveRoute(host, routeID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user