...
|
...
|
@@ -61,6 +61,30 @@ var _ = Describe("更新任务", func() { |
|
|
ContainsKey("taskId").ValueEqual("taskId", 1)
|
|
|
})
|
|
|
})
|
|
|
Context("更新指派任务", func() {
|
|
|
BeforeEach(func() {
|
|
|
_, err := pG.DB.QueryOne(
|
|
|
pg.Scan(),
|
|
|
"INSERT INTO tasks (id, company_id, task_name, task_type, sponsor, task_status, reference_resource, project_belong, customer_values, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
|
|
1, 101, "testTaskName", 3, "{}", 1, "{}", 1, pg.Array([]int{1}), 1, 100.00, "testAcceptanceStandard", "testTaskDescription", pg.Array([]string{"url"}), false)
|
|
|
Expect(err).NotTo(HaveOccurred())
|
|
|
})
|
|
|
It("返回更新后的任务数据", func() {
|
|
|
httpExpect := httpexpect.New(GinkgoT(), server.URL)
|
|
|
body := map[string]interface{}{
|
|
|
}
|
|
|
httpExpect.PUT("/tasks/1").
|
|
|
WithJSON(body).
|
|
|
Expect().
|
|
|
Status(http.StatusOK).
|
|
|
JSON().
|
|
|
Object().
|
|
|
ContainsKey("code").ValueEqual("code", 0).
|
|
|
ContainsKey("msg").ValueEqual("msg", "ok").
|
|
|
ContainsKey("data").Value("data").Object().
|
|
|
ContainsKey("taskId").ValueEqual("taskId", 1)
|
|
|
})
|
|
|
})
|
|
|
Context("任务不在未发布状态下提交正确的任务数据", func() {
|
|
|
BeforeEach(func() {
|
|
|
_, err := pG.DB.QueryOne(
|
...
|
...
|
|