@@ -419,35 +419,35 @@ func Test_WebhookPushDevBranch(t *testing.T) {
419
419
defer gitRepo .Close ()
420
420
421
421
// only for dev branch
422
- testAPICreateWebhookForRepo (t , session , "user2" , "repo1" , provider .URL (), "push" , "new_branch " )
422
+ testAPICreateWebhookForRepo (t , session , "user2" , "repo1" , provider .URL (), "push" , "new_dev_branch " )
423
423
424
424
// 2. this should not trigger the webhook
425
425
testCreateFile (t , session , "user2" , "repo1" , "master" , "test_webhook_push.md" , "# a test file for webhook push" , "" )
426
426
assert .Empty (t , triggeredEvent )
427
427
assert .Empty (t , payloads )
428
428
429
- _ , err = gitRepo .GetBranchCommitID ("new_branch " )
429
+ _ , err = gitRepo .GetBranchCommitID ("new_dev_branch " )
430
430
assert .Error (t , err )
431
431
432
432
fromBranchCommitID , err := gitRepo .GetBranchCommitID ("develop" )
433
433
assert .NoError (t , err )
434
434
435
435
// 3. trigger the webhook
436
- testCreateFile (t , session , "user2" , "repo1" , "develop" , "test_webhook_push.md" , "# a test file for webhook push" , "new_branch " )
436
+ testCreateFile (t , session , "user2" , "repo1" , "develop" , "test_webhook_push.md" , "# a test file for webhook push" , "new_dev_branch " )
437
437
438
- afterCommitID , err := gitRepo .GetBranchCommitID ("new_branch " )
438
+ afterCommitID , err := gitRepo .GetBranchCommitID ("new_dev_branch " )
439
439
assert .NoError (t , err )
440
440
441
441
beforeCommitID := git .Sha1ObjectFormat .EmptyObjectID ().String ()
442
442
443
443
// 4. validate the webhook is triggered
444
444
assert .Equal (t , "push" , triggeredEvent )
445
445
assert .Len (t , payloads , 1 )
446
- assert .Equal (t , "refs/heads/new_branch " , payloads [0 ].Ref )
446
+ assert .Equal (t , "refs/heads/new_dev_branch " , payloads [0 ].Ref )
447
447
assert .Equal (t , beforeCommitID , payloads [0 ].Before )
448
448
assert .Equal (t , afterCommitID , payloads [0 ].After )
449
449
assert .Equal (t , "repo1" , payloads [0 ].Repo .Name )
450
- assert .Equal (t , "new_branch " , payloads [0 ].Branch ())
450
+ assert .Equal (t , "new_dev_branch " , payloads [0 ].Branch ())
451
451
assert .Equal (t , "user2/repo1" , payloads [0 ].Repo .FullName )
452
452
assert .Len (t , payloads [0 ].Commits , 1 )
453
453
assert .Equal (t , afterCommitID , payloads [0 ].Commits [0 ].ID )
0 commit comments