Skip to content

Commit d76108c

Browse files
fix a couple more tests
1 parent 8f364fd commit d76108c

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

tests/integration/org_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ func TestOrgRestrictedUser(t *testing.T) {
149149
// public_repo_on_private_org is a public repo on privated_org
150150
repoName := "public_repo_on_private_org"
151151

152+
repoGroup := 340
153+
152154
// user29 is a restricted user who is not a member of the organization
153155
restrictedUser := "user29"
154156

@@ -159,7 +161,7 @@ func TestOrgRestrictedUser(t *testing.T) {
159161
req := NewRequest(t, "GET", "/"+orgName)
160162
restrictedSession.MakeRequest(t, req, http.StatusNotFound)
161163

162-
req = NewRequest(t, "GET", fmt.Sprintf("/%s/%s", orgName, repoName))
164+
req = NewRequest(t, "GET", fmt.Sprintf("/%s/group/%d/%s", orgName, repoGroup, repoName))
163165
restrictedSession.MakeRequest(t, req, http.StatusNotFound)
164166

165167
// Therefore create a read-only team

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, "repo1", "user1", "repo1", "user2", "")
223+
testRepoFork(t, user1Session, 0, "user1", "repo1", "user2", "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.

tests/integration/repo_watch_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func TestRepoWatch(t *testing.T) {
1818
setting.Service.AutoWatchOnChanges = true
1919
session := loginUser(t, "user2")
2020
unittest.AssertNotExistsBean(t, &repo_model.Watch{UserID: 2, RepoID: 3})
21-
testEditFile(t, session, 0, "org3", "repo3", "master", "README.md", "Hello, World (Edited for watch)\n")
21+
testEditFile(t, session, 129, "org3", "repo3", "master", "README.md", "Hello, World (Edited for watch)\n")
2222
unittest.AssertExistsAndLoadBean(t, &repo_model.Watch{UserID: 2, RepoID: 3, Mode: repo_model.WatchModeAuto})
2323
})
2424
}

tests/integration/timetracking_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func TestViewTimetrackingControls(t *testing.T) {
3737
}
3838

3939
func testViewTimetrackingControls(t *testing.T, session *TestSession, groupID int64, repo, issue string, canTrackTime bool, user string) {
40-
req := NewRequest(t, "GET", path.Join(user, repo, "issues", issue))
40+
req := NewRequest(t, "GET", path.Join(user, maybeGroupSegment(groupID), repo, "issues", issue))
4141
resp := session.MakeRequest(t, req, http.StatusOK)
4242

4343
htmlDoc := NewHTMLParser(t, resp.Body)

0 commit comments

Comments
 (0)