作者 yangfu

add user

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() {
... ... @@ -29,7 +29,7 @@ var _ = Describe("移除我收藏的菜单", func() {
Object().
ContainsKey("code").ValueEqual("code", 0).
ContainsKey("msg").ValueEqual("msg", "ok").
ContainsKey("data").Value("data").Object()
ContainsKey("data").Value("data").Object()
})
})
})
... ... @@ -37,4 +37,4 @@ var _ = Describe("移除我收藏的菜单", func() {
_, err := pG.DB.Exec("DELETE FROM users WHERE true")
Expect(err).NotTo(HaveOccurred())
})
})
\ No newline at end of file
})
... ...
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() {
... ... @@ -29,7 +29,7 @@ var _ = Describe("获取我收藏的菜单", func() {
Object().
ContainsKey("code").ValueEqual("code", 0).
ContainsKey("msg").ValueEqual("msg", "ok").
ContainsKey("data").Value("data").Object()
ContainsKey("data").Value("data").Object()
})
})
})
... ... @@ -37,4 +37,4 @@ var _ = Describe("获取我收藏的菜单", func() {
_, err := pG.DB.Exec("DELETE FROM users WHERE true")
Expect(err).NotTo(HaveOccurred())
})
})
\ No newline at end of file
})
... ...
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
})
... ...
package user
package user-favorite-menus
import (
"github.com/beego/beego/v2/server/web"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"net/http"
"net/http/httptest"
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/application"
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg"
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/port/beego"
"testing"
"github.com/beego/beego/v2/server/web"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg"
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/port/beego"
"net/http"
"net/http/httptest"
"testing"
)
func TestUserFavoriteMenus(t *testing.T) {
... ... @@ -27,4 +26,4 @@ var _ = BeforeSuite(func() {
var _ = AfterSuite(func() {
server.Close()
})
\ No newline at end of file
})
... ...