File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ package cmd
2222
2323import (
2424 "fmt"
25+ "strconv"
2526 "testing"
2627
2728 "github.com/stretchr/testify/require"
@@ -37,7 +38,7 @@ func TestDeleteProjectHook(t *testing.T) {
3738 }{
3839 {
3940 name : "successfully delete a project hook" ,
40- args : []string {"6 " },
41+ args : []string {"" }, // to be filled in test setup
4142 flagsMap : map [string ]string {
4243 "project" : "23" ,
4344 },
@@ -55,14 +56,17 @@ func TestDeleteProjectHook(t *testing.T) {
5556
5657 for _ , tc := range tt {
5758 t .Run (tc .name , func (t * testing.T ) {
59+ // SETUP
60+ // Create the project, get it's id for testing
5861 if tc .expect == pass {
5962 sampleHookURL := "http://example.com/"
60- _ , err := newProjectHook ("23" , & gitlab.AddProjectHookOptions {
63+ hook , err := newProjectHook ("23" , & gitlab.AddProjectHookOptions {
6164 URL : & sampleHookURL ,
6265 })
6366 if err != nil {
6467 tInfo (fmt .Sprintf ("failed to create project hook %s" , tc .args [0 ]))
6568 }
69+ tc .args [0 ] = strconv .Itoa (hook .ID )
6670 }
6771
6872 execT := execTestCmdFlags {
You can’t perform that action at this time.
0 commit comments