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:
Héctor Hurtado
2019-10-04 13:55:36 +02:00
parent b93a5a0c98
commit 6b34047d75
6 changed files with 31 additions and 80 deletions
+9 -1
View File
@@ -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")
}
}