...
|
...
|
@@ -2,6 +2,7 @@ package notice_setting |
|
|
|
|
|
import (
|
|
|
"net/http"
|
|
|
"time"
|
|
|
|
|
|
"github.com/gavv/httpexpect"
|
|
|
"github.com/go-pg/pg/v10"
|
...
|
...
|
@@ -15,8 +16,8 @@ var _ = Describe("更新编排消息通知内容", func() { |
|
|
BeforeEach(func() {
|
|
|
_, err := pG.DB.QueryOne(
|
|
|
pg.Scan(¬iceSettingId),
|
|
|
"INSERT INTO notice_settings (company_id, content, is_push, module, module_action, notice_setting_id, org_id, sys_code, created_at, deleted_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING notice_setting_id",
|
|
|
"testCompanyId", "testContent", "testIsPush", "testModule", "testModuleAction", "testNoticeSettingId", "testOrgId", "testSysCode", "testCreatedAt", "testDeletedAt", "testUpdatedAt")
|
|
|
"INSERT INTO notice_settings (company_id, content, is_push, module, module_action, notice_setting_id, org_id, created_at, deleted_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING notice_setting_id",
|
|
|
11, "testContent", 1, "testModule", "testModuleAction", 10086, 110, time.Now(), time.Now(), time.Now())
|
|
|
Expect(err).NotTo(HaveOccurred())
|
|
|
})
|
|
|
Describe("提交数据更新编排消息通知内容", func() {
|
...
|
...
|
@@ -24,19 +25,15 @@ var _ = Describe("更新编排消息通知内容", func() { |
|
|
It("返回更新后的编排消息通知内容数据", func() {
|
|
|
httpExpect := httpexpect.New(GinkgoT(), server.URL)
|
|
|
body := map[string]interface{}{
|
|
|
"companyId": "int64",
|
|
|
"companyId": 11,
|
|
|
"content": "string",
|
|
|
"isPush": "int",
|
|
|
"module": "string",
|
|
|
"moduleAction": "string",
|
|
|
"noticeSettingId": "int64",
|
|
|
"orgId": "int64",
|
|
|
"sysCode": "string",
|
|
|
"createdAt": "datetime",
|
|
|
"deletedAt": "datetime",
|
|
|
"updatedAt": "datetime",
|
|
|
"isPush": 2,
|
|
|
"module": "module01",
|
|
|
"moduleAction": "action01_01",
|
|
|
"noticeSettingId": 10086,
|
|
|
"orgId": 110,
|
|
|
}
|
|
|
httpExpect.PUT("/notice-setting/{Id}").
|
|
|
httpExpect.PUT("/notice-setting/10086").
|
|
|
WithJSON(body).
|
|
|
Expect().
|
|
|
Status(http.StatusOK).
|
...
|
...
|
@@ -44,8 +41,7 @@ var _ = Describe("更新编排消息通知内容", func() { |
|
|
Object().
|
|
|
ContainsKey("code").ValueEqual("code", 0).
|
|
|
ContainsKey("msg").ValueEqual("msg", "ok").
|
|
|
ContainsKey("data").Value("data").Object().
|
|
|
ContainsKey("noticeSettingId").ValueEqual("noticeSettingId", noticeSettingId)
|
|
|
ContainsKey("data").Value("data").Object()
|
|
|
})
|
|
|
})
|
|
|
})
|
...
|
...
|
|