From bba2d6d204aa213b515c81b1b1f4656a41ed7e43 Mon Sep 17 00:00:00 2001 From: Francisco Miamoto Date: Wed, 12 Aug 2020 09:07:52 -0300 Subject: [PATCH] improve test cases --- pkg/cmd/api/api_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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, }, {