|
@@ -40,34 +40,31 @@ func TestPreGoodsOrder(t *testing.T) {
|
40
|
40
|
// 业务返回判断
|
41
|
41
|
So(result.Code, ShouldEqual, http.StatusOK)
|
42
|
42
|
So(result.Result, ShouldNotBeEmpty)
|
43
|
|
- })
|
44
|
|
- })
|
45
|
|
-}
|
46
|
43
|
|
47
|
|
-func TestConfirmOrders(t *testing.T) {
|
48
|
|
- orderID := "cc84338e-488e-463b-a33e-7dc7f2cd10b6"
|
|
44
|
+ orderID := result.Result.(map[string]interface{})["OrdersId"].(string)
|
49
|
45
|
|
50
|
|
- Convey("下单确认", t, func() {
|
51
|
|
- result := &controllers.JSONMessage{}
|
52
|
|
- api := "/api/wechat/MQ/order/goods/" + orderID
|
|
46
|
+ Convey("下单确认", func() {
|
|
47
|
+ result := &controllers.JSONMessage{}
|
|
48
|
+ api := "/api/wechat/MQ/order/goods/" + orderID
|
53
|
49
|
|
54
|
|
- token := &utils.JWTToken{
|
55
|
|
- Guest: false,
|
56
|
|
- ID: "oMOpz0kgTrasoAA3G70R7phomn1g", // openid
|
57
|
|
- Expire: time.Now().Local().Add(24 * 30 * time.Hour),
|
58
|
|
- BatchNo: "",
|
59
|
|
- }
|
|
50
|
+ token := &utils.JWTToken{
|
|
51
|
+ Guest: false,
|
|
52
|
+ ID: "oMOpz0kgTrasoAA3G70R7phomn1g", // openid
|
|
53
|
+ Expire: time.Now().Local().Add(24 * 30 * time.Hour),
|
|
54
|
+ BatchNo: "",
|
|
55
|
+ }
|
60
|
56
|
|
61
|
|
- code, _, err := NewRequestMock().
|
62
|
|
- AddToken(token.ToMap()).
|
63
|
|
- AddWechatUA().
|
64
|
|
- Request(http.MethodPut, api, nil, result)
|
|
57
|
+ code, _, err := NewRequestMock().
|
|
58
|
+ AddToken(token.ToMap()).
|
|
59
|
+ AddWechatUA().
|
|
60
|
+ Request(http.MethodPut, api, nil, result)
|
65
|
61
|
|
66
|
|
- So(code, ShouldEqual, http.StatusOK)
|
67
|
|
- So(err, ShouldBeNil)
|
|
62
|
+ So(code, ShouldEqual, http.StatusOK)
|
|
63
|
+ So(err, ShouldBeNil)
|
68
|
64
|
|
69
|
|
- // 业务返回判断
|
70
|
|
- So(result.Code, ShouldEqual, http.StatusOK)
|
|
65
|
+ // 业务返回判断
|
|
66
|
+ So(result.Code, ShouldEqual, http.StatusOK)
|
|
67
|
+ })
|
|
68
|
+ })
|
71
|
69
|
})
|
72
|
|
-
|
73
|
70
|
}
|