(t *testing.T)
| 586 | } |
| 587 | |
| 588 | func TestPRCheckout_differentRepo(t *testing.T) { |
| 589 | http := &httpmock.Registry{} |
| 590 | defer http.Verify(t) |
| 591 | |
| 592 | baseRepo, pr := stubPR("OWNER/REPO:master", "hubot/REPO:feature") |
| 593 | finder := shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo) |
| 594 | finder.ExpectFields([]string{"number", "headRefName", "headRepository", "headRepositoryOwner", "isCrossRepository", "maintainerCanModify"}) |
| 595 | |
| 596 | cs, cmdTeardown := run.Stub() |
| 597 | defer cmdTeardown(t) |
| 598 | cs.Register(`git fetch origin refs/pull/123/head:feature --no-tags`, 0, "") |
| 599 | cs.Register(`git config branch\.feature\.merge`, 1, "") |
| 600 | cs.Register(`git checkout feature`, 0, "") |
| 601 | cs.Register(`git config branch\.feature\.remote origin`, 0, "") |
| 602 | cs.Register(`git config branch\.feature\.pushRemote origin`, 0, "") |
| 603 | cs.Register(`git config branch\.feature\.merge refs/pull/123/head`, 0, "") |
| 604 | |
| 605 | output, err := runCommand(http, nil, "master", `123`, baseRepo) |
| 606 | assert.NoError(t, err) |
| 607 | assert.Equal(t, "", output.String()) |
| 608 | assert.Equal(t, "", output.Stderr()) |
| 609 | } |
| 610 | |
| 611 | func TestPRCheckout_differentRepoForce(t *testing.T) { |
| 612 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected