Fix method used in client.AddRoute()
Co-authored-by: César Gallego <gallego.cesar@gmail.com>
This commit is contained in:
@@ -16,5 +16,5 @@ func AddRoute(host, path, method, entrypoint, command string, w io.Writer) error
|
|||||||
"url_pattern": path,
|
"url_pattern": path,
|
||||||
"entrypoint": entrypoint,
|
"entrypoint": entrypoint,
|
||||||
"command": command})
|
"command": command})
|
||||||
return http.Put(url, "application/json", bytes.NewReader(body), w)
|
return http.Post(url, "application/json", bytes.NewReader(body), w)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
func TestSuccessOnCorrectRoute(t *testing.T) {
|
func TestSuccessOnCorrectRoute(t *testing.T) {
|
||||||
defer gock.Off()
|
defer gock.Off()
|
||||||
gock.New("http://localhost").
|
gock.New("http://localhost").
|
||||||
Put("/routes").
|
Post("/routes").
|
||||||
MatchType("json").
|
MatchType("json").
|
||||||
JSON(map[string]string{
|
JSON(map[string]string{
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
|
|||||||
Reference in New Issue
Block a user