...
|
...
|
@@ -14,8 +14,8 @@ var _ = Describe("更新我喜欢菜单列表", func() { |
|
|
BeforeEach(func() {
|
|
|
_, err := pG.DB.QueryOne(
|
|
|
pg.Scan(&userId),
|
|
|
"INSERT INTO users (user_id, company_id, user_base_id, user_type, user_code, organization_id, department_id, user_info, user_org, user_role, favorite_menus, cooperation_info, enable_status, ext, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING user_id",
|
|
|
"testUserId", "testCompanyId", "testUserBaseId", "testUserType", "testUserCode", "testOrganizationId", "testDepartmentId", "testUserInfo", "testUserOrg", "testUserRole", "testFavoriteMenus", "testCooperationInfo", "testEnableStatus", "testExt", "testCreatedAt", "testUpdatedAt")
|
|
|
"INSERT INTO \"users\".\"user\"(\"user_id\", \"company_id\", \"user_base_id\", \"user_type\", \"user_code\", \"organization_id\", \"department_id\", \"user_org\", \"user_role\", \"favorite_menus\", \"cooperation_info\", \"enable_status\", \"ext\", \"created_at\", \"updated_at\") VALUES (999, 5, 999, 1025, 'ADMIN01', 5, 5, '[{\"orgId\": 5, \"orgName\": \"string1\", \"createdAt\": \"0001-01-01T00:00:00Z\", \"deletedAt\": \"0001-01-01T00:00:00Z\", \"updatedAt\": \"0001-01-01T00:00:00Z\"}]', '[{\"ext\": {\"orgName\": \"string1\"}, \"roleId\": 5, \"roleName\": \"企业管理员\", \"createdAt\": \"0001-01-01T00:00:00Z\", \"updatedAt\": \"0001-01-01T00:00:00Z\"}]', '[]', '{\"cooperationCompany\": \"\", \"cooperationDeadline\": \"0001-01-01T00:00:00Z\"}', 1, '{\"phone\": \"18860183031\", \"depName\": \"string1\", \"orgName\": \"string1\"}', '2021-07-24 10:16:17.680805+08', '2021-07-24 10:16:17.680805+08');\n",
|
|
|
)
|
|
|
Expect(err).NotTo(HaveOccurred())
|
|
|
})
|
|
|
Describe("更新我喜欢菜单列表", func() {
|
...
|
...
|
@@ -23,9 +23,10 @@ var _ = Describe("更新我喜欢菜单列表", func() { |
|
|
It("", func() {
|
|
|
httpExpect := httpexpect.New(GinkgoT(), server.URL)
|
|
|
body := map[string]interface{}{
|
|
|
"favoriteMenus": "array",
|
|
|
"favoriteMenus": []string{"favorite-menu"},
|
|
|
//"userId":999,
|
|
|
}
|
|
|
httpExpect.PUT("/user/{userId}/favorite-menus").
|
|
|
httpExpect.PUT("/user/999/favorite-menus").
|
|
|
WithJSON(body).
|
|
|
Expect().
|
|
|
Status(http.StatusOK).
|
...
|
...
|
@@ -38,7 +39,7 @@ var _ = Describe("更新我喜欢菜单列表", func() { |
|
|
})
|
|
|
})
|
|
|
AfterEach(func() {
|
|
|
_, err := pG.DB.Exec("DELETE FROM users WHERE true")
|
|
|
_, err := pG.DB.Exec(`DELETE FROM users."user" WHERE true`)
|
|
|
Expect(err).NotTo(HaveOccurred())
|
|
|
})
|
|
|
}) |
...
|
...
|
|