summaryrefslogtreecommitdiffstats
path: root/models/fixtures
diff options
context:
space:
mode:
authorEthan Koenig <ethantkoenig@gmail.com>2017-01-24 11:16:36 -0500
committerEthan Koenig <ethantkoenig@gmail.com>2017-01-27 12:24:06 -0500
commita2412492da2def90457a2a20fd043bea21ef415f (patch)
tree842907cb6d69db617e5c048d23a864c8bbd6b22a /models/fixtures
parentbb5a6b7a07125b29604f479f45e59073cb3d4648 (diff)
downloadgitea-a2412492da2def90457a2a20fd043bea21ef415f.tar.gz
gitea-a2412492da2def90457a2a20fd043bea21ef415f.zip
Unit tests and bug fix for models/org
Diffstat (limited to 'models/fixtures')
-rw-r--r--models/fixtures/org_user.yml24
-rw-r--r--models/fixtures/repository.yml12
-rw-r--r--models/fixtures/team.yml28
-rw-r--r--models/fixtures/team_repo.yml12
-rw-r--r--models/fixtures/team_user.yml24
-rw-r--r--models/fixtures/user.yml38
6 files changed, 135 insertions, 3 deletions
diff --git a/models/fixtures/org_user.yml b/models/fixtures/org_user.yml
index b4df3c0127..a7b8d178aa 100644
--- a/models/fixtures/org_user.yml
+++ b/models/fixtures/org_user.yml
@@ -5,3 +5,27 @@
is_public: true
is_owner: true
num_teams: 1
+
+-
+ id: 2
+ uid: 4
+ org_id: 3
+ is_public: false
+ is_owner: false
+ num_teams: 0
+
+-
+ id: 3
+ uid: 5
+ org_id: 6
+ is_public: true
+ is_owner: true
+ num_teams: 1
+
+-
+ id: 4
+ uid: 5
+ org_id: 7
+ is_public: false
+ is_owner: true
+ num_teams: 1
diff --git a/models/fixtures/repository.yml b/models/fixtures/repository.yml
index 00b0077283..c415f20732 100644
--- a/models/fixtures/repository.yml
+++ b/models/fixtures/repository.yml
@@ -41,3 +41,15 @@
num_closed_issues: 0
num_pulls: 0
num_closed_pulls: 0
+
+-
+ id: 5
+ owner_id: 3
+ lower_name: repo5
+ name: repo5
+ is_private: true
+ num_issues: 0
+ num_closed_issues: 0
+ num_pulls: 0
+ num_closed_pulls: 0
+ is_mirror: true
diff --git a/models/fixtures/team.yml b/models/fixtures/team.yml
index 9746f50d81..99e228efeb 100644
--- a/models/fixtures/team.yml
+++ b/models/fixtures/team.yml
@@ -1,7 +1,35 @@
-
id: 1
org_id: 3
+ lower_name: owners
+ name: owners
+ authorize: 4 # owner
+ num_repos: 1
+ num_members: 1
+
+-
+ id: 2
+ org_id: 3
lower_name: team1
name: team1
authorize: 2 # write
num_repos: 1
+ num_members: 2
+
+-
+ id: 3
+ org_id: 6
+ lower_name: owners
+ name: owners
+ authorize: 4 # owner
+ num_repos: 0
+ num_members: 1
+
+-
+ id: 4
+ org_id: 7
+ lower_name: owners
+ name: owners
+ authorize: 4 # owner
+ num_repos: 0
+ num_members: 1
diff --git a/models/fixtures/team_repo.yml b/models/fixtures/team_repo.yml
index b954ae8c10..1f7385e7e9 100644
--- a/models/fixtures/team_repo.yml
+++ b/models/fixtures/team_repo.yml
@@ -3,3 +3,15 @@
org_id: 3
team_id: 1
repo_id: 3
+
+-
+ id: 2
+ org_id: 3
+ team_id: 2
+ repo_id: 3
+
+-
+ id: 3
+ org_id: 3
+ team_id: 1
+ repo_id: 5
diff --git a/models/fixtures/team_user.yml b/models/fixtures/team_user.yml
index e569f9f3d9..955a80e4cd 100644
--- a/models/fixtures/team_user.yml
+++ b/models/fixtures/team_user.yml
@@ -3,3 +3,27 @@
org_id: 3
team_id: 1
uid: 2
+
+-
+ id: 2
+ org_id: 3
+ team_id: 2
+ uid: 2
+
+-
+ id: 3
+ org_id: 3
+ team_id: 2
+ uid: 4
+
+-
+ id: 4
+ org_id: 6
+ team_id: 3
+ uid: 5
+
+-
+ id: 5
+ org_id: 7
+ team_id: 4
+ uid: 5
diff --git a/models/fixtures/user.yml b/models/fixtures/user.yml
index a38b4016e3..aa1d80d6f0 100644
--- a/models/fixtures/user.yml
+++ b/models/fixtures/user.yml
@@ -38,7 +38,8 @@
is_admin: false
avatar: avatar3
avatar_email: user3@example.com
- num_repos: 1
+ num_repos: 2
+ num_members: 2
-
id: 4
@@ -47,7 +48,7 @@
full_name: User Four
email: user4@example.com
passwd: password
- type: 1 # individual
+ type: 0 # individual
salt: salt
is_admin: false
avatar: avatar4
@@ -61,9 +62,40 @@
full_name: User Five
email: user5@example.com
passwd: password
- type: 1 # individual
+ type: 0 # individual
salt: salt
is_admin: false
avatar: avatar5
avatar_email: user5@example.com
num_repos: 1
+ allow_create_organization: false
+
+-
+ id: 6
+ lower_name: user6
+ name: user6
+ full_name: User Six
+ email: user6@example.com
+ passwd: password
+ type: 1 # organization
+ salt: salt
+ is_admin: false
+ avatar: avatar6
+ avatar_email: user6@example.com
+ num_repos: 0
+ num_members: 1
+
+-
+ id: 7
+ lower_name: user7
+ name: user7
+ full_name: User Seven
+ email: user7@example.com
+ passwd: password
+ type: 1 # organization
+ salt: salt
+ is_admin: false
+ avatar: avatar7
+ avatar_email: user7@example.com
+ num_repos: 0
+ num_members: 1