create_upload_image_test.go 732 字节
package vod

import (
	"github.com/gavv/httpexpect"
	"github.com/onsi/ginkgo"
	"net/http"
)

var _ = ginkgo.Describe("创建图片上传凭证(单图片)", func() {
	ginkgo.Describe("创建图片上传凭证(单图片)", func() {
		ginkgo.Context("", func() {
			ginkgo.It("", func() {
				httpExpect := httpexpect.New(ginkgo.GinkgoT(), server.URL)
				body := map[string]interface{}{
					"fileName": "test.jpg",
				}
				httpExpect.POST("/v1/vod/createUploadImage").
					WithJSON(body).
					WithHeader("x-mmm-appproject", "opportunity").
					Expect().
					Status(http.StatusOK).
					JSON().
					Object().
					ContainsKey("code").ValueEqual("code", 0).
					ContainsKey("msg").ValueEqual("msg", "成功")
			})
		})
	})
})