Added gock.IsDone() to route list and remove tests. Remove content type in route remove command. Removed disturbing data for texts. Remove unneeded test in set command.
This commit is contained in:
@@ -14,12 +14,16 @@ func TestRemoveRouteExistent(t *testing.T) {
|
||||
)
|
||||
|
||||
defer gock.Off()
|
||||
gock.New(host).Delete("/routes/" + routeID).MatchType("json").Reply(http.StatusNoContent)
|
||||
gock.New(host).Delete("/routes/" + routeID).Reply(http.StatusNoContent)
|
||||
|
||||
err := RemoveRoute(host, routeID)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error: ‘%s’", err)
|
||||
}
|
||||
|
||||
if !gock.IsDone() {
|
||||
t.Errorf("No endpoint called")
|
||||
}
|
||||
}
|
||||
|
||||
func TestRemoveRouteNonExistent(t *testing.T) {
|
||||
@@ -38,4 +42,8 @@ func TestRemoveRouteNonExistent(t *testing.T) {
|
||||
} else if err.Error() != expected {
|
||||
t.Errorf("error mismatch: expected ‘%s’, got ‘%s’", expected, err)
|
||||
}
|
||||
|
||||
if !gock.IsDone() {
|
||||
t.Errorf("No endpoint called")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user