This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
2017-03-25 16:09:17 +01:00
|
|
|
package http
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/genofire/hs_master-kss-monolith/test"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestStatus(t *testing.T) {
|
|
|
|
assertion, router := test.Init(t)
|
2017-03-30 19:05:33 +02:00
|
|
|
|
2017-03-25 16:09:17 +01:00
|
|
|
BindAPI(router)
|
|
|
|
session := test.NewSession(router)
|
|
|
|
|
2017-03-30 18:43:18 +02:00
|
|
|
r, w := session.JSONRequest("GET", "/api/status", nil)
|
|
|
|
result := r.(map[string]interface{})
|
2017-03-25 16:09:17 +01:00
|
|
|
assertion.Equal(http.StatusOK, w.StatusCode)
|
2017-03-30 18:43:18 +02:00
|
|
|
assertion.Equal("running", result["status"])
|
|
|
|
assertion.Equal(float64(0), result["review_count"])
|
2017-03-25 16:09:17 +01:00
|
|
|
|
2017-03-30 19:05:33 +02:00
|
|
|
test.Close()
|
2017-03-25 16:09:17 +01:00
|
|
|
}
|