Semaphore/api/api_test.go

23 lines
387 B
Go
Raw Normal View History

package api
import (
2021-08-26 13:41:42 +02:00
//_ "github.com/snikch/goodman/hooks"
//_ "github.com/snikch/goodman/transaction"
"net/http"
"net/http/httptest"
"testing"
2020-02-09 13:25:06 +01:00
)
func TestApiPing(t *testing.T) {
req, _ := http.NewRequest("GET", "/api/ping", nil)
rr := httptest.NewRecorder()
r := Route()
r.ServeHTTP(rr, req)
if rr.Code != 200 {
t.Errorf("Response code should be 200 %d", rr.Code)
}
}