summaryrefslogtreecommitdiffstats
path: root/models/webhook_test.go
diff options
context:
space:
mode:
authorRémy Boulanouar <rboulanouar@gmail.com>2017-05-29 09:17:15 +0200
committerBo-Yi Wu <appleboy.tw@gmail.com>2017-05-29 02:17:15 -0500
commite0c6ab2d44d17b72a7ea6f8b4c829c42baeaae3b (patch)
tree44e906f5ac3a322832e5d9a55ea59bf613d36b24 /models/webhook_test.go
parente67ece26f0b97437200998b9b153b4c3a87a65aa (diff)
downloadgitea-e0c6ab2d44d17b72a7ea6f8b4c829c42baeaae3b.tar.gz
gitea-e0c6ab2d44d17b72a7ea6f8b4c829c42baeaae3b.zip
Add Gitea Webhook (#1755)
* Replace Gogs by Gitea * Fix missing changes * Create Gitea webhook and put Gogs webhook apart.
Diffstat (limited to 'models/webhook_test.go')
-rw-r--r--models/webhook_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/models/webhook_test.go b/models/webhook_test.go
index 3f377eae7a..a637a16999 100644
--- a/models/webhook_test.go
+++ b/models/webhook_test.go
@@ -191,16 +191,19 @@ func TestDeleteWebhookByOrgID(t *testing.T) {
func TestToHookTaskType(t *testing.T) {
assert.Equal(t, GOGS, ToHookTaskType("gogs"))
assert.Equal(t, SLACK, ToHookTaskType("slack"))
+ assert.Equal(t, GITEA, ToHookTaskType("gitea"))
}
func TestHookTaskType_Name(t *testing.T) {
assert.Equal(t, "gogs", GOGS.Name())
assert.Equal(t, "slack", SLACK.Name())
+ assert.Equal(t, "gitea", GITEA.Name())
}
func TestIsValidHookTaskType(t *testing.T) {
assert.True(t, IsValidHookTaskType("gogs"))
assert.True(t, IsValidHookTaskType("slack"))
+ assert.True(t, IsValidHookTaskType("gitea"))
assert.False(t, IsValidHookTaskType("invalid"))
}
@@ -221,7 +224,7 @@ func TestCreateHookTask(t *testing.T) {
hookTask := &HookTask{
RepoID: 3,
HookID: 3,
- Type: GOGS,
+ Type: GITEA,
URL: "http://www.example.com/unit_test",
Payloader: &api.PushPayload{},
}