photoprism/internal/api/index_test.go
Michael Mayer a7122ff4e1 Add /folders API to get directory lists for browsing #260
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-05-22 16:29:12 +02:00

20 lines
469 B
Go

package api
import (
"github.com/stretchr/testify/assert"
"github.com/tidwall/gjson"
"net/http"
"testing"
)
func TestCancelIndex(t *testing.T) {
t.Run("successful request", func(t *testing.T) {
app, router, conf := NewApiTest()
CancelIndexing(router, conf)
r := PerformRequest(app, "DELETE", "/api/v1/index")
val := gjson.Get(r.Body.String(), "message")
assert.Equal(t, "indexing canceled", val.String())
assert.Equal(t, http.StatusOK, r.Code)
})
}