mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-17 11:59:30 +00:00
Unit tests for models/access.go (#606)
This commit is contained in:
parent
8422ab542c
commit
6072b03291
10 changed files with 258 additions and 0 deletions
11
models/fixtures/access.yml
Normal file
11
models/fixtures/access.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
-
|
||||
id: 1
|
||||
user_id: 2
|
||||
repo_id: 3
|
||||
mode: 2 # write
|
||||
|
||||
-
|
||||
id: 2
|
||||
repo_id: 4
|
||||
user_id: 4
|
||||
mode: 2 # write
|
11
models/fixtures/collaboration.yml
Normal file
11
models/fixtures/collaboration.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
-
|
||||
id: 1
|
||||
repo_id: 3
|
||||
user_id: 2
|
||||
mode: 2 # write
|
||||
|
||||
-
|
||||
id: 2
|
||||
repo_id: 4
|
||||
user_id: 4
|
||||
mode: 2 # write
|
7
models/fixtures/org_user.yml
Normal file
7
models/fixtures/org_user.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
-
|
||||
id: 1
|
||||
uid: 2
|
||||
org_id: 3
|
||||
is_public: true
|
||||
is_owner: true
|
||||
num_teams: 1
|
|
@ -19,3 +19,25 @@
|
|||
num_closed_issues: 1
|
||||
num_pulls: 0
|
||||
num_closed_pulls: 0
|
||||
|
||||
-
|
||||
id: 3
|
||||
owner_id: 3
|
||||
lower_name: repo3
|
||||
name: repo3
|
||||
is_private: true
|
||||
num_issues: 0
|
||||
num_closed_issues: 0
|
||||
num_pulls: 0
|
||||
num_closed_pulls: 0
|
||||
|
||||
-
|
||||
id: 4
|
||||
owner_id: 5
|
||||
lower_name: repo4
|
||||
name: repo4
|
||||
is_private: false
|
||||
num_issues: 0
|
||||
num_closed_issues: 0
|
||||
num_pulls: 0
|
||||
num_closed_pulls: 0
|
||||
|
|
7
models/fixtures/team.yml
Normal file
7
models/fixtures/team.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
-
|
||||
id: 1
|
||||
org_id: 3
|
||||
lower_name: team1
|
||||
name: team1
|
||||
authorize: 2 # write
|
||||
num_repos: 1
|
5
models/fixtures/team_repo.yml
Normal file
5
models/fixtures/team_repo.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
-
|
||||
id: 1
|
||||
org_id: 3
|
||||
team_id: 1
|
||||
repo_id: 3
|
5
models/fixtures/team_user.yml
Normal file
5
models/fixtures/team_user.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
-
|
||||
id: 1
|
||||
org_id: 3
|
||||
team_id: 1
|
||||
uid: 2
|
|
@ -23,3 +23,42 @@
|
|||
avatar: avatar2
|
||||
avatar_email: user2@example.com
|
||||
num_repos: 2
|
||||
|
||||
-
|
||||
id: 3
|
||||
lower_name: user3
|
||||
name: user3
|
||||
email: user3@example.com
|
||||
passwd: password
|
||||
type: 1 # organization
|
||||
salt: salt
|
||||
is_admin: false
|
||||
avatar: avatar3
|
||||
avatar_email: user3@example.com
|
||||
num_repos: 1
|
||||
|
||||
-
|
||||
id: 4
|
||||
lower_name: user4
|
||||
name: user4
|
||||
email: user4@example.com
|
||||
passwd: password
|
||||
type: 1 # individual
|
||||
salt: salt
|
||||
is_admin: false
|
||||
avatar: avatar4
|
||||
avatar_email: user4@example.com
|
||||
num_repos: 0
|
||||
|
||||
-
|
||||
id: 5
|
||||
lower_name: user5
|
||||
name: user5
|
||||
email: user5@example.com
|
||||
passwd: password
|
||||
type: 1 # individual
|
||||
salt: salt
|
||||
is_admin: false
|
||||
avatar: avatar5
|
||||
avatar_email: user5@example.com
|
||||
num_repos: 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue