Skip to content

Commit 00e933e

Browse files
more test fixes
1 parent 0ec87cc commit 00e933e

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

tests/integration/editor_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func testEditorActionEdit(t *testing.T, session *TestSession, groupID int64, use
127127
resp := testEditorActionPostRequest(t, session, fmt.Sprintf("/%s/%s%s/%s/%s/%s", user, maybeGroupSegment(groupID), repo, editorAction, branch, filePath), params)
128128
assert.Equal(t, http.StatusOK, resp.Code)
129129
assert.NotEmpty(t, test.RedirectURL(resp))
130-
req := NewRequest(t, "GET", path.Join(user, repo, "raw/branch", newBranchName, params["tree_path"]))
130+
req := NewRequest(t, "GET", path.Join(user, maybeGroupSegment(groupID), repo, "raw/branch", newBranchName, params["tree_path"]))
131131
resp = session.MakeRequest(t, req, http.StatusOK)
132132
assert.Equal(t, params["content"], resp.Body.String())
133133
return resp

tests/integration/pull_compare_test.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,14 @@ func TestPullCompare_EnableAllowEditsFromMaintainer(t *testing.T) {
103103
// user4 creates a new branch and a PR
104104
testEditFileToNewBranch(t, user4Session, 0, "user4", forkedRepoName, "master", "user4/update-readme", "README.md", "Hello, World\n(Edited by user4)\n")
105105
resp := testPullCreateDirectly(t, user4Session, createPullRequestOptions{
106-
BaseRepoOwner: repo3.OwnerName,
107-
BaseRepoName: repo3.Name,
108-
BaseBranch: "master",
109-
HeadRepoOwner: "user4",
110-
HeadRepoName: forkedRepoName,
111-
HeadBranch: "user4/update-readme",
112-
Title: "PR for user4 forked repo3",
106+
BaseRepoOwner: repo3.OwnerName,
107+
BaseRepoName: repo3.Name,
108+
BaseRepoGroupID: repo3.GroupID,
109+
BaseBranch: "master",
110+
HeadRepoOwner: "user4",
111+
HeadRepoName: forkedRepoName,
112+
HeadBranch: "user4/update-readme",
113+
Title: "PR for user4 forked repo3",
113114
})
114115
prURL := test.RedirectURL(resp)
115116

tests/integration/pull_create_test.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,15 @@ func testPullCreate(t *testing.T, session *TestSession, user, repo string, toSel
6464
}
6565

6666
type createPullRequestOptions struct {
67-
BaseRepoOwner string
68-
BaseRepoName string
69-
BaseBranch string
70-
HeadRepoOwner string
71-
HeadRepoName string
72-
HeadBranch string
73-
Title string
74-
ReviewerIDs string // comma-separated list of user IDs
67+
BaseRepoOwner string
68+
BaseRepoName string
69+
BaseRepoGroupID int64
70+
BaseBranch string
71+
HeadRepoOwner string
72+
HeadRepoName string
73+
HeadBranch string
74+
Title string
75+
ReviewerIDs string // comma-separated list of user IDs
7576
}
7677

7778
func (opts createPullRequestOptions) IsValid() bool {
@@ -92,7 +93,7 @@ func testPullCreateDirectly(t *testing.T, session *TestSession, opts createPullR
9293
headCompare = fmt.Sprintf("%s:%s", opts.HeadRepoOwner, opts.HeadBranch)
9394
}
9495
}
95-
req := NewRequest(t, "GET", fmt.Sprintf("/%s/%s/compare/%s...%s", opts.BaseRepoOwner, opts.BaseRepoName, opts.BaseBranch, headCompare))
96+
req := NewRequest(t, "GET", fmt.Sprintf("/%s/%s%s/compare/%s...%s", opts.BaseRepoOwner, maybeGroupSegment(opts.BaseRepoGroupID), opts.BaseRepoName, opts.BaseBranch, headCompare))
9697
resp := session.MakeRequest(t, req, http.StatusOK)
9798

9899
// Submit the form for creating the pull

tests/integration/pull_review_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func TestPullView_GivenApproveOrRejectReviewOnClosedPR(t *testing.T) {
220220
user2Session := loginUser(t, "user2")
221221

222222
// Have user1 create a fork of repo1.
223-
testRepoFork(t, user1Session, 0, "user1", "repo1", "user2", "repo1", "")
223+
testRepoFork(t, user1Session, 0, "user2", "repo1", "user1", "repo1", "")
224224

225225
t.Run("Submit approve/reject review on merged PR", func(t *testing.T) {
226226
// Create a merged PR (made by user1) in the upstream repo1.

0 commit comments

Comments
 (0)