rove/cmd/rove-server/router_test.go
Marc Di Luzio 73a1e1fd21 Housekeeping
Move docs and commands out into their own files
2020-05-30 22:46:53 +01:00

22 lines
401 B
Go

package main
import (
"encoding/json"
"net/http"
"net/http/httptest"
"testing"
)
func TestHandleStatus(t *testing.T) {
request, _ := http.NewRequest(http.MethodGet, "/status", nil)
response := httptest.NewRecorder()
HandleStatus(response, request)
var status RouterStatus
json.NewDecoder(response.Body).Decode(&status)
if status.Ready != true {
t.Errorf("got false for /status")
}
}