From 8ca136bb804911123ffa9855cbdef4c15fec5d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Tue, 25 Nov 2025 21:20:42 -0500 Subject: [PATCH] fix a couple more tests --- tests/integration/org_test.go | 4 +++- tests/integration/pull_review_test.go | 2 +- tests/integration/repo_watch_test.go | 2 +- tests/integration/timetracking_test.go | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/integration/org_test.go b/tests/integration/org_test.go index 3105da609c..6476f11587 100644 --- a/tests/integration/org_test.go +++ b/tests/integration/org_test.go @@ -150,6 +150,8 @@ func testOrgRestrictedUser(t *testing.T) { // public_repo_on_private_org is a public repo on privated_org repoName := "public_repo_on_private_org" + repoGroup := 340 + // user29 is a restricted user who is not a member of the organization restrictedUser := "user29" @@ -160,7 +162,7 @@ func testOrgRestrictedUser(t *testing.T) { req := NewRequest(t, "GET", "/"+orgName) restrictedSession.MakeRequest(t, req, http.StatusNotFound) - req = NewRequest(t, "GET", fmt.Sprintf("/%s/%s", orgName, repoName)) + req = NewRequest(t, "GET", fmt.Sprintf("/%s/group/%d/%s", orgName, repoGroup, repoName)) restrictedSession.MakeRequest(t, req, http.StatusNotFound) // Therefore create a read-only team diff --git a/tests/integration/pull_review_test.go b/tests/integration/pull_review_test.go index f1350861d5..e602ce23a0 100644 --- a/tests/integration/pull_review_test.go +++ b/tests/integration/pull_review_test.go @@ -220,7 +220,7 @@ func TestPullView_GivenApproveOrRejectReviewOnClosedPR(t *testing.T) { user2Session := loginUser(t, "user2") // Have user1 create a fork of repo1. - testRepoFork(t, user1Session, 0, "repo1", "user1", "repo1", "user2", "") + testRepoFork(t, user1Session, 0, "user1", "repo1", "user2", "repo1", "") t.Run("Submit approve/reject review on merged PR", func(t *testing.T) { // Create a merged PR (made by user1) in the upstream repo1. diff --git a/tests/integration/repo_watch_test.go b/tests/integration/repo_watch_test.go index 48cdaceebf..e3ca8c1796 100644 --- a/tests/integration/repo_watch_test.go +++ b/tests/integration/repo_watch_test.go @@ -18,7 +18,7 @@ func TestRepoWatch(t *testing.T) { setting.Service.AutoWatchOnChanges = true session := loginUser(t, "user2") unittest.AssertNotExistsBean(t, &repo_model.Watch{UserID: 2, RepoID: 3}) - testEditFile(t, session, 0, "org3", "repo3", "master", "README.md", "Hello, World (Edited for watch)\n") + testEditFile(t, session, 129, "org3", "repo3", "master", "README.md", "Hello, World (Edited for watch)\n") unittest.AssertExistsAndLoadBean(t, &repo_model.Watch{UserID: 2, RepoID: 3, Mode: repo_model.WatchModeAuto}) }) } diff --git a/tests/integration/timetracking_test.go b/tests/integration/timetracking_test.go index 0b3e1dd1fc..c83b8d5468 100644 --- a/tests/integration/timetracking_test.go +++ b/tests/integration/timetracking_test.go @@ -37,7 +37,7 @@ func TestViewTimetrackingControls(t *testing.T) { } func testViewTimetrackingControls(t *testing.T, session *TestSession, groupID int64, repo, issue string, canTrackTime bool, user string) { - req := NewRequest(t, "GET", path.Join(user, repo, "issues", issue)) + req := NewRequest(t, "GET", path.Join(user, maybeGroupSegment(groupID), repo, "issues", issue)) resp := session.MakeRequest(t, req, http.StatusOK) htmlDoc := NewHTMLParser(t, resp.Body)