Skip to content

Commit 81a6135

Browse files
Add test case for creating repo when have team creation access.
Signed-off-by: David Svantesson <[email protected]>
1 parent 8d98450 commit 81a6135

File tree

4 files changed

+55
-1
lines changed

4 files changed

+55
-1
lines changed

integrations/api_repo_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ func TestAPIOrgRepoCreate(t *testing.T) {
347347
{ctxUserID: 1, orgName: "user3", repoName: "repo-admin", expectedStatus: http.StatusCreated},
348348
{ctxUserID: 2, orgName: "user3", repoName: "repo-own", expectedStatus: http.StatusCreated},
349349
{ctxUserID: 2, orgName: "user6", repoName: "repo-bad-org", expectedStatus: http.StatusForbidden},
350+
{ctxUserID: 27, orgName: "user3", repoName: "repo-creator", expectedStatus: http.StatusCreated},
351+
{ctxUserID: 27, orgName: "user6", repoName: "repo-not-creator", expectedStatus: http.StatusForbidden},
350352
}
351353

352354
prepareTestEnv(t)

models/fixtures/team.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,23 @@
9696
authorize: 1 # read
9797
num_repos: 0
9898
num_members: 0
99+
100+
-
101+
id: 12
102+
org_id: 3
103+
lower_name: team12creators
104+
name: team12Creators
105+
authorize: 3 # admin
106+
num_repos: 0
107+
num_members: 1
108+
can_create_org_repo: true
109+
110+
-
111+
id: 13
112+
org_id: 6
113+
lower_name: team13notcreators
114+
name: team13NotCreators
115+
authorize: 3 # admin
116+
num_repos: 0
117+
num_members: 1
118+
can_create_org_repo: false

models/fixtures/team_user.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,15 @@
6969
org_id: 25
7070
team_id: 10
7171
uid: 24
72+
73+
-
74+
id: 13
75+
org_id: 3
76+
team_id: 12
77+
uid: 27
78+
79+
-
80+
id: 14
81+
org_id: 6
82+
team_id: 13
83+
uid: 27

models/fixtures/user.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,4 +427,24 @@
427427
num_repos: 1
428428
num_members: 0
429429
num_teams: 1
430-
repo_admin_change_team_access: true
430+
repo_admin_change_team_access: true
431+
432+
-
433+
id: 27
434+
lower_name: user27
435+
name: user27
436+
full_name: "user27"
437+
438+
keep_email_private: true
439+
passwd: 7d93daa0d1e6f2305cc8fa496847d61dc7320bb16262f9c55dd753480207234cdd96a93194e408341971742f4701772a025a # password
440+
type: 0 # individual
441+
salt: ZogKvWdyEx
442+
is_admin: false
443+
avatar: avatar27
444+
avatar_email: [email protected]
445+
num_repos: 0
446+
num_stars: 0
447+
num_followers: 0
448+
num_following: 0
449+
is_active: true
450+

0 commit comments

Comments
 (0)