Semaphore/api/api_test.go
2021-05-15 17:23:47 +05:00

21 lines
303 B
Go

package api
import (
"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)
}
}