diff options
Diffstat (limited to 'modules/webhook/dingtalk_test.go')
-rw-r--r-- | modules/webhook/dingtalk_test.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/webhook/dingtalk_test.go b/modules/webhook/dingtalk_test.go index 4cb7a913e6..e5aa0fca36 100644 --- a/modules/webhook/dingtalk_test.go +++ b/modules/webhook/dingtalk_test.go @@ -14,18 +14,18 @@ import ( func TestGetDingTalkIssuesPayload(t *testing.T) { p := issueTestPayload() - + d := new(DingtalkPayload) p.Action = api.HookIssueOpened - pl, err := getDingtalkIssuesPayload(p) + pl, err := d.Issue(p) require.NoError(t, err) require.NotNil(t, pl) - assert.Equal(t, "#2 crash", pl.ActionCard.Title) - assert.Equal(t, "[test/repo] Issue opened: #2 crash by user1\r\n\r\n", pl.ActionCard.Text) + assert.Equal(t, "#2 crash", pl.(*DingtalkPayload).ActionCard.Title) + assert.Equal(t, "[test/repo] Issue opened: #2 crash by user1\r\n\r\n", pl.(*DingtalkPayload).ActionCard.Text) p.Action = api.HookIssueClosed - pl, err = getDingtalkIssuesPayload(p) + pl, err = d.Issue(p) require.NoError(t, err) require.NotNil(t, pl) - assert.Equal(t, "#2 crash", pl.ActionCard.Title) - assert.Equal(t, "[test/repo] Issue closed: #2 crash by user1\r\n\r\n", pl.ActionCard.Text) + assert.Equal(t, "#2 crash", pl.(*DingtalkPayload).ActionCard.Title) + assert.Equal(t, "[test/repo] Issue closed: #2 crash by user1\r\n\r\n", pl.(*DingtalkPayload).ActionCard.Text) } |