2020-07-14 17:59:50 +02:00
|
|
|
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")
|
2020-07-14 18:08:39 +02:00
|
|
|
assert.Equal(t, http.StatusBadRequest, r.Code)
|
2020-07-14 17:59:50 +02:00
|
|
|
})
|
|
|
|
}
|