@@ -419,35 +419,35 @@ func Test_WebhookPushDevBranch(t *testing.T) {
419419 defer gitRepo .Close ()
420420
421421 // 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 " )
423423
424424 // 2. this should not trigger the webhook
425425 testCreateFile (t , session , "user2" , "repo1" , "master" , "test_webhook_push.md" , "# a test file for webhook push" , "" )
426426 assert .Empty (t , triggeredEvent )
427427 assert .Empty (t , payloads )
428428
429- _ , err = gitRepo .GetBranchCommitID ("new_branch " )
429+ _ , err = gitRepo .GetBranchCommitID ("new_dev_branch " )
430430 assert .Error (t , err )
431431
432432 fromBranchCommitID , err := gitRepo .GetBranchCommitID ("develop" )
433433 assert .NoError (t , err )
434434
435435 // 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 " )
437437
438- afterCommitID , err := gitRepo .GetBranchCommitID ("new_branch " )
438+ afterCommitID , err := gitRepo .GetBranchCommitID ("new_dev_branch " )
439439 assert .NoError (t , err )
440440
441441 beforeCommitID := git .Sha1ObjectFormat .EmptyObjectID ().String ()
442442
443443 // 4. validate the webhook is triggered
444444 assert .Equal (t , "push" , triggeredEvent )
445445 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 )
447447 assert .Equal (t , beforeCommitID , payloads [0 ].Before )
448448 assert .Equal (t , afterCommitID , payloads [0 ].After )
449449 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 ())
451451 assert .Equal (t , "user2/repo1" , payloads [0 ].Repo .FullName )
452452 assert .Len (t , payloads [0 ].Commits , 1 )
453453 assert .Equal (t , afterCommitID , payloads [0 ].Commits [0 ].ID )
0 commit comments