Semaphore/api/api_test.go
2021-08-26 16:41:42 +05:00

23 lines
387 B
Go

package api
import (
//_ "github.com/snikch/goodman/hooks"
//_ "github.com/snikch/goodman/transaction"
"net/http"
"net/http/httptest"
"testing"
)
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)
}
}