2018-04-11 20:05:38 +02:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
2021-08-26 13:41:42 +02:00
|
|
|
//_ "github.com/snikch/goodman/hooks"
|
|
|
|
//_ "github.com/snikch/goodman/transaction"
|
2020-10-02 21:09:06 +02:00
|
|
|
"net/http"
|
|
|
|
"net/http/httptest"
|
2018-04-11 20:05:38 +02:00
|
|
|
"testing"
|
2020-02-09 13:25:06 +01:00
|
|
|
)
|
2018-04-11 20:05:38 +02:00
|
|
|
|
2020-10-02 21:09:06 +02: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)
|
|
|
|
}
|
|
|
|
}
|