4
0

baselines_api_test.go 430 B

1234567891011121314151617181920
  1. package httpapi_test
  2. import (
  3. "net/http"
  4. "testing"
  5. )
  6. func TestBaselinesEndpointEmpty(t *testing.T) {
  7. ts := makeTestServer(t)
  8. _, cookie, _ := loginCookie(t, ts.URL, "admin", "test123456")
  9. res := get(t, ts.URL, "/api/baselines", cookie)
  10. if res.StatusCode != http.StatusOK {
  11. t.Fatalf("status: %d", res.StatusCode)
  12. }
  13. body := readJSON(t, res)
  14. if len(body) != 0 {
  15. t.Fatalf("expected empty baselines, got %v", body)
  16. }
  17. }