diff --git a/pkg/cmd/api/api_test.go b/pkg/cmd/api/api_test.go index 284a1a47a..a810fa7fc 100644 --- a/pkg/cmd/api/api_test.go +++ b/pkg/cmd/api/api_test.go @@ -757,7 +757,7 @@ func Test_fillPlaceholders(t *testing.T) { { name: "has branch placeholder", args: args{ - value: "repos/cli/cli/branches/:branch", + value: "repos/cli/cli/branches/:branch/protection/required_status_checks", opts: &ApiOptions{ BaseRepo: func() (ghrepo.Interface, error) { return ghrepo.New("cli", "cli"), nil @@ -767,13 +767,13 @@ func Test_fillPlaceholders(t *testing.T) { }, }, }, - want: "repos/cli/cli/branches/trunk", + want: "repos/cli/cli/branches/trunk/protection/required_status_checks", wantErr: false, }, { - name: "has branch placeholder and git is on detached head", + name: "has branch placeholder and git is in detached head", args: args{ - value: "repos/cli/cli/branches/:branch", + value: "repos/:owner/:repo/branches/:branch", opts: &ApiOptions{ BaseRepo: func() (ghrepo.Interface, error) { return ghrepo.New("cli", "cli"), nil @@ -783,7 +783,7 @@ func Test_fillPlaceholders(t *testing.T) { }, }, }, - want: "repos/cli/cli/branches/:branch", + want: "repos/:owner/:repo/branches/:branch", wantErr: true, }, {