mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-06 00:59:45 +02:00
fix a couple more tests
This commit is contained in:
parent
99e51331bd
commit
8ca136bb80
@ -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
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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})
|
||||
})
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user