|
|
package user
|
|
|
|
|
|
package user-favorite-menus
|
|
|
import (
|
|
|
"github.com/gavv/httpexpect"
|
|
|
"github.com/go-pg/pg/v10"
|
|
|
pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg"
|
|
|
. "github.com/onsi/ginkgo"
|
|
|
. "github.com/onsi/gomega"
|
|
|
"net/http"
|
|
|
"github.com/gavv/httpexpect"
|
|
|
"github.com/go-pg/pg/v10"
|
|
|
. "github.com/onsi/ginkgo"
|
|
|
. "github.com/onsi/gomega"
|
|
|
pG "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg"
|
|
|
"net/http"
|
|
|
)
|
|
|
|
|
|
var _ = Describe("更新我喜欢菜单列表", func() {
|
...
|
...
|
@@ -22,18 +22,18 @@ var _ = Describe("更新我喜欢菜单列表", func() { |
|
|
Context("", func() {
|
|
|
It("", func() {
|
|
|
httpExpect := httpexpect.New(GinkgoT(), server.URL)
|
|
|
body := map[string]interface{}{
|
|
|
body := map[string]interface{}{
|
|
|
"favoriteMenus": "array",
|
|
|
}
|
|
|
httpExpect.PUT("/user/{userId}/favorite-menus").
|
|
|
WithJSON(body).
|
|
|
WithJSON(body).
|
|
|
Expect().
|
|
|
Status(http.StatusOK).
|
|
|
JSON().
|
|
|
Object().
|
|
|
ContainsKey("code").ValueEqual("code", 0).
|
|
|
ContainsKey("msg").ValueEqual("msg", "ok").
|
|
|
ContainsKey("data").Value("data").Object()
|
|
|
ContainsKey("data").Value("data").Object()
|
|
|
})
|
|
|
})
|
|
|
})
|
...
|
...
|
@@ -41,4 +41,4 @@ var _ = Describe("更新我喜欢菜单列表", func() { |
|
|
_, err := pG.DB.Exec("DELETE FROM users WHERE true")
|
|
|
Expect(err).NotTo(HaveOccurred())
|
|
|
})
|
|
|
}) |
|
|
\ No newline at end of file |
|
|
}) |
...
|
...
|
|