(t *testing.T)
| 981 | } |
| 982 | |
| 983 | func TestPRCheckout_differentRepo(t *testing.T) { |
| 984 | http := &httpmock.Registry{} |
| 985 | defer http.Verify(t) |
| 986 | |
| 987 | baseRepo, pr := stubPR("OWNER/REPO:master", "hubot/REPO:feature") |
| 988 | finder := shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo) |
| 989 | finder.ExpectFields([]string{"number", "headRefName", "headRepository", "headRepositoryOwner", "isCrossRepository", "maintainerCanModify"}) |
| 990 | |
| 991 | cs, cmdTeardown := run.Stub() |
| 992 | defer cmdTeardown(t) |
| 993 | cs.Register(`git fetch origin refs/pull/123/head:feature --no-tags`, 0, "") |
| 994 | cs.Register(`git config branch\.feature\.merge`, 1, "") |
| 995 | cs.Register(`git checkout feature`, 0, "") |
| 996 | cs.Register(`git config branch\.feature\.remote origin`, 0, "") |
| 997 | cs.Register(`git config branch\.feature\.pushRemote origin`, 0, "") |
| 998 | cs.Register(`git config branch\.feature\.merge refs/pull/123/head`, 0, "") |
| 999 | |
| 1000 | output, err := runCommand(http, nil, "master", `123`, baseRepo) |
| 1001 | assert.NoError(t, err) |
| 1002 | assert.Equal(t, "", output.String()) |
| 1003 | assert.Equal(t, "", output.Stderr()) |
| 1004 | } |
| 1005 | |
| 1006 | func TestPRCheckout_differentRepoForce(t *testing.T) { |
| 1007 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected