Fix compile error
This commit is contained in:
parent
5330cdd988
commit
885455454c
@ -623,38 +623,6 @@ func TestCompleteTaskInvalidId(t *testing.T) {
|
||||
e.POST("/task/999/complete").Expect().Status(404)
|
||||
}
|
||||
|
||||
func TestCompleteTaskAllowanceWeightsSumTo0(t *testing.T) {
|
||||
e := startServer(t)
|
||||
taskId := createTestTaskWithAmount(e, 101)
|
||||
|
||||
e.GET("/tasks").Expect().Status(200).JSON().Array().Length().IsEqual(1)
|
||||
|
||||
// Update rest allowance
|
||||
e.PUT("/user/1/allowance/0").WithJSON(UpdateAllowanceRequest{
|
||||
Weight: 0,
|
||||
}).Expect().Status(200)
|
||||
// Create two allowance goals
|
||||
e.POST("/user/1/allowance").WithJSON(CreateAllowanceRequest{
|
||||
Name: "Test Allowance 1",
|
||||
Target: 1000,
|
||||
Weight: 0,
|
||||
}).Expect().Status(201)
|
||||
|
||||
// Complete the task
|
||||
e.POST("/task/" + strconv.Itoa(taskId) + "/complete").Expect().Status(200)
|
||||
|
||||
// Verify the task is marked as completed
|
||||
e.GET("/task/" + strconv.Itoa(taskId)).Expect().Status(404)
|
||||
|
||||
// Verify the allowances are updated for user 1
|
||||
allowances := e.GET("/user/1/allowance").Expect().Status(200).JSON().Array()
|
||||
allowances.Length().IsEqual(2)
|
||||
allowances.Value(0).Object().Value("id").Number().IsEqual(0)
|
||||
allowances.Value(0).Object().Value("progress").Number().IsEqual(101)
|
||||
allowances.Value(1).Object().Value("id").Number().IsEqual(1)
|
||||
allowances.Value(1).Object().Value("progress").Number().IsEqual(0)
|
||||
}
|
||||
|
||||
func TestCompleteAllowance(t *testing.T) {
|
||||
e := startServer(t)
|
||||
createTestTaskWithAmount(e, 100)
|
||||
|
Loading…
x
Reference in New Issue
Block a user