Skip to content

Commit 4ed9e41

Browse files
committed
fix test
1 parent c6edde1 commit 4ed9e41

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/integration/repo_branch_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ func TestRecentlyPushedNewBranches(t *testing.T) {
273273
checkRecentlyPushedNewBranches(t, user1Session, "user12/repo10", []string{"private_org35/org35_fork_repo10:new-commit"})
274274

275275
// user2 push a branch in private_org35
276-
testCreateBranch(t, user2Session, orgPrivateForkRepo.OwnerName, orgPrivateForkRepo.Name, "branch/new-commit", "user-no-permission", http.StatusSeeOther)
276+
testCreateBranch(t, user2Session, orgPrivateForkRepo.OwnerName, orgPrivateForkRepo.Name, "branch/new-commit", "user-read-permission", http.StatusSeeOther)
277277
// convert write permission to read permission for code unit
278278
token := getTokenForLoggedInUser(t, user1Session, auth_model.AccessTokenScopeWriteOrganization)
279279
req := NewRequestWithJSON(t, "PATCH", fmt.Sprintf("/api/v1/teams/%d", 24), &api.EditTeamOption{
@@ -283,7 +283,7 @@ func TestRecentlyPushedNewBranches(t *testing.T) {
283283
MakeRequest(t, req, http.StatusOK)
284284
teamUnit := unittest.AssertExistsAndLoadBean(t, &org_model.TeamUnit{TeamID: 24, Type: unit.TypeCode})
285285
assert.Equal(t, perm.AccessModeRead, teamUnit.AccessMode)
286-
// user2 should not see the branch
287-
checkRecentlyPushedNewBranches(t, user2Session, "user12/repo10", []string{})
286+
// user2 can see the branch as it is created by user2
287+
checkRecentlyPushedNewBranches(t, user2Session, "user12/repo10", []string{"private_org35/org35_fork_repo10:user-read-permission"})
288288
})
289289
}

0 commit comments

Comments
 (0)