photoprism/internal/api/status_test.go
2020-05-06 12:56:13 +02:00

19 lines
453 B
Go

package api
import (
"github.com/stretchr/testify/assert"
"github.com/tidwall/gjson"
"net/http"
"testing"
)
func TestGetStatus(t *testing.T) {
t.Run("successful request", func(t *testing.T) {
app, router, conf := NewApiTest()
GetStatus(router, conf)
r := PerformRequest(app, "GET", "/api/v1/status")
val := gjson.Get(r.Body.String(), "status")
assert.Equal(t, "operational", val.String())
assert.Equal(t, http.StatusOK, r.Code)
})
}