Vendoring with Glide and delete function handler

This commit is contained in:
Alex Ellis
2017-04-26 19:13:42 +01:00
parent 1eaf13c6c8
commit 78af82021f
7137 changed files with 1688302 additions and 19 deletions

View File

@ -0,0 +1,34 @@
package inttests
import (
"net/http"
"testing"
)
func TestDelete_EmptyFunctionGivenFails(t *testing.T) {
reqBody := `{"functionName":""}`
_, code, err := fireRequest("http://localhost:8080/system/functions", http.MethodDelete, reqBody)
if err != nil {
t.Log(err)
t.Fail()
}
if code != http.StatusBadRequest {
t.Errorf("Got HTTP code: %d, want %d\n", code, http.StatusBadRequest)
}
}
func TestDelete_NonExistingFunctionGives404(t *testing.T) {
reqBody := `{"functionName":"does_not_exist"}`
_, code, err := fireRequest("http://localhost:8080/system/functions", http.MethodDelete, reqBody)
if err != nil {
t.Log(err)
t.Fail()
}
if code != http.StatusNotFound {
t.Errorf("Got HTTP code: %d, want %d\n", code, http.StatusNotFound)
}
}