photoprism/internal/api/upload_test.go
2020-07-14 18:08:48 +02:00

16 lines
321 B
Go

package api
import (
"github.com/stretchr/testify/assert"
"net/http"
"testing"
)
func TestUpload(t *testing.T) {
t.Run("forbidden", func(t *testing.T) {
app, router, _ := NewApiTest()
Upload(router)
r := PerformRequest(app, "POST", "/api/v1/upload/xxx")
assert.Equal(t, http.StatusBadRequest, r.Code)
})
}