Test: Ping route
This commit is contained in:
parent
6f96018223
commit
1db0c6116e
1 changed files with 20 additions and 0 deletions
20
routers/router_test.go
Normal file
20
routers/router_test.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package routers
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPing(t *testing.T) {
|
||||
asserts := assert.New(t)
|
||||
router := InitRouter()
|
||||
|
||||
w := httptest.NewRecorder()
|
||||
req, _ := http.NewRequest("GET", "/Api/V3/Ping", nil)
|
||||
router.ServeHTTP(w, req)
|
||||
|
||||
assert.Equal(t, 200, w.Code)
|
||||
asserts.Contains(w.Body.String(), "Pong")
|
||||
}
|
Loading…
Add table
Reference in a new issue