summaryrefslogtreecommitdiffstats
path: root/modules/webhook/slack_test.go
diff options
context:
space:
mode:
authorStephen Solka <solka@hey.com>2020-07-19 05:53:40 -0400
committerGitHub <noreply@github.com>2020-07-19 12:53:40 +0300
commit54513452a1134de670467e5a8d5cebd768b3c7e4 (patch)
tree48e39d2e52daa88cf93431dd6b0642e482a5e018 /modules/webhook/slack_test.go
parentb609a25014cf732ec444c132dc9fb892818281dc (diff)
downloadgitea-54513452a1134de670467e5a8d5cebd768b3c7e4.tar.gz
gitea-54513452a1134de670467e5a8d5cebd768b3c7e4.zip
prefer NoError/Error over Nil/NotNil (#12271)
Diffstat (limited to 'modules/webhook/slack_test.go')
-rw-r--r--modules/webhook/slack_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/webhook/slack_test.go b/modules/webhook/slack_test.go
index a418c8e2e2..15503434f8 100644
--- a/modules/webhook/slack_test.go
+++ b/modules/webhook/slack_test.go
@@ -20,13 +20,13 @@ func TestSlackIssuesPayloadOpened(t *testing.T) {
p.Action = api.HookIssueOpened
pl, err := getSlackIssuesPayload(p, sl)
- require.Nil(t, err)
+ require.NoError(t, err)
require.NotNil(t, pl)
assert.Equal(t, "[<http://localhost:3000/test/repo|test/repo>] Issue opened: <http://localhost:3000/test/repo/issues/2|#2 crash> by <https://try.gitea.io/user1|user1>", pl.Text)
p.Action = api.HookIssueClosed
pl, err = getSlackIssuesPayload(p, sl)
- require.Nil(t, err)
+ require.NoError(t, err)
require.NotNil(t, pl)
assert.Equal(t, "[<http://localhost:3000/test/repo|test/repo>] Issue closed: <http://localhost:3000/test/repo/issues/2|#2 crash> by <https://try.gitea.io/user1|user1>", pl.Text)
}
@@ -39,7 +39,7 @@ func TestSlackIssueCommentPayload(t *testing.T) {
}
pl, err := getSlackIssueCommentPayload(p, sl)
- require.Nil(t, err)
+ require.NoError(t, err)
require.NotNil(t, pl)
assert.Equal(t, "[<http://localhost:3000/test/repo|test/repo>] New comment on issue <http://localhost:3000/test/repo/issues/2|#2 crash> by <https://try.gitea.io/user1|user1>", pl.Text)
@@ -53,7 +53,7 @@ func TestSlackPullRequestCommentPayload(t *testing.T) {
}
pl, err := getSlackIssueCommentPayload(p, sl)
- require.Nil(t, err)
+ require.NoError(t, err)
require.NotNil(t, pl)
assert.Equal(t, "[<http://localhost:3000/test/repo|test/repo>] New comment on pull request <http://localhost:3000/test/repo/pulls/2|#2 Fix bug> by <https://try.gitea.io/user1|user1>", pl.Text)
@@ -67,7 +67,7 @@ func TestSlackReleasePayload(t *testing.T) {
}
pl, err := getSlackReleasePayload(p, sl)
- require.Nil(t, err)
+ require.NoError(t, err)
require.NotNil(t, pl)
assert.Equal(t, "[<http://localhost:3000/test/repo|test/repo>] Release created: <http://localhost:3000/test/repo/src/v1.0|v1.0> by <https://try.gitea.io/user1|user1>", pl.Text)
@@ -81,7 +81,7 @@ func TestSlackPullRequestPayload(t *testing.T) {
}
pl, err := getSlackPullRequestPayload(p, sl)
- require.Nil(t, err)
+ require.NoError(t, err)
require.NotNil(t, pl)
assert.Equal(t, "[<http://localhost:3000/test/repo|test/repo>] Pull request opened: <http://localhost:3000/test/repo/pulls/12|#2 Fix bug> by <https://try.gitea.io/user1|user1>", pl.Text)