create_upload_images_test.go
801 字节
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{}{
"items": []struct {
FileName string `json:"fileName"`
}{{FileName: "test.jpg"}},
}
httpExpect.POST("/v1/vod/createUploadImages").
WithJSON(body).
WithHeader("x-mmm-appproject", "opportunity").
Expect().
Status(http.StatusOK).
JSON().
Object().
ContainsKey("code").ValueEqual("code", 0).
ContainsKey("msg").ValueEqual("msg", "成功")
})
})
})
})