mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-12-03 14:51:05 +01:00
21 lines
303 B
Go
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)
|
|
}
|
|
}
|