You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
753 B
29 lines
753 B
package bnj |
|
|
|
import ( |
|
"context" |
|
"testing" |
|
|
|
"github.com/smartystreets/goconvey/convey" |
|
|
|
"gopkg.in/h2non/gock.v1" |
|
) |
|
|
|
func TestBnjSendWechat(t *testing.T) { |
|
convey.Convey("SendWechat", t, func(ctx convey.C) { |
|
var ( |
|
c = context.Background() |
|
title = "【拜年祭必看!】拜年祭预约人数到达预警" |
|
msg = "拜年祭预约人数即将到达50w,请及时准备拜年祭抽奖事项。" |
|
user = "wuhao02" |
|
) |
|
ctx.Convey("When everything gose positive", func(ctx convey.C) { |
|
defer gock.OffAll() |
|
httpMock("POST", _wechatURL).Reply(200).JSON(`{"RetCode":0}`) |
|
err := d.SendWechat(c, title, msg, user) |
|
ctx.Convey("Then err should be nil.", func(ctx convey.C) { |
|
ctx.So(err, convey.ShouldBeNil) |
|
}) |
|
}) |
|
}) |
|
}
|
|
|