aboutsummaryrefslogtreecommitdiffstats
path: root/models/fixtures
diff options
context:
space:
mode:
authorEthan Koenig <ethantkoenig@gmail.com>2017-01-01 13:15:09 -0500
committerEthan Koenig <ethantkoenig@gmail.com>2017-01-06 10:08:23 -0500
commit72bfabfada8fc485b88eb4547b7d3575789a69c8 (patch)
tree838a128004ac7e3417816171c1f3e60b98edcd57 /models/fixtures
parent1a7fc53c98f06f79955d217f91c8a5553e5a27b3 (diff)
downloadgitea-72bfabfada8fc485b88eb4547b7d3575789a69c8.tar.gz
gitea-72bfabfada8fc485b88eb4547b7d3575789a69c8.zip
Unit tests for models/pull.go
Diffstat (limited to 'models/fixtures')
-rw-r--r--models/fixtures/issue.yml46
-rw-r--r--models/fixtures/pull_request.yml28
-rw-r--r--models/fixtures/repository.yml21
-rw-r--r--models/fixtures/user.yml25
4 files changed, 120 insertions, 0 deletions
diff --git a/models/fixtures/issue.yml b/models/fixtures/issue.yml
new file mode 100644
index 0000000000..dbd435939a
--- /dev/null
+++ b/models/fixtures/issue.yml
@@ -0,0 +1,46 @@
+-
+ id: 1
+ repo_id: 1
+ index: 1
+ poster_id: 1
+ name: issue1
+ content: content1
+ is_closed: false
+ is_pull: false
+ created_unix: 946684800
+ updated_unix: 978307200
+
+-
+ id: 2
+ repo_id: 1
+ index: 2
+ poster_id: 1
+ name: issue2
+ content: content2
+ is_closed: false
+ is_pull: true
+ created_unix: 946684810
+ updated_unix: 978307190
+
+
+-
+ id: 3
+ repo_id: 1
+ index: 3
+ poster_id: 1
+ name: issue3
+ content: content4
+ is_closed: false
+ is_pull: true
+ created_unix: 946684820
+ updated_unix: 978307180
+
+-
+ id: 4
+ repo_id: 2
+ index: 1
+ poster_id: 2
+ name: issue4
+ content: content4
+ is_closed: true
+ is_pull: false
diff --git a/models/fixtures/pull_request.yml b/models/fixtures/pull_request.yml
new file mode 100644
index 0000000000..34de6693ee
--- /dev/null
+++ b/models/fixtures/pull_request.yml
@@ -0,0 +1,28 @@
+-
+ id: 1
+ type: 0 # gitea pull request
+ status: 2 # mergable
+ issue_id: 2
+ index: 1
+ head_repo_id: 1
+ base_repo_id: 1
+ head_user_name: user1
+ head_branch: branch1
+ base_branch: master
+ merge_base: 1234567890abcdef
+ has_merged: true
+ merger_id: 2
+
+-
+ id: 2
+ type: 0 # gitea pull request
+ status: 1 # checking
+ issue_id: 3
+ index: 2
+ head_repo_id: 1
+ base_repo_id: 1
+ head_user_name: user1
+ head_branch: branch2
+ base_branch: master
+ merge_base: fedcba9876543210
+ has_merged: false
diff --git a/models/fixtures/repository.yml b/models/fixtures/repository.yml
new file mode 100644
index 0000000000..21d9184d13
--- /dev/null
+++ b/models/fixtures/repository.yml
@@ -0,0 +1,21 @@
+-
+ id: 1
+ owner_id: 2
+ lower_name: repo1
+ name: repo1
+ is_private: false
+ num_issues: 1
+ num_closed_issues: 0
+ num_pulls: 2
+ num_closed_pulls: 0
+
+-
+ id: 2
+ owner_id: 2
+ lower_name: repo2
+ name: repo2
+ is_private: true
+ num_issues: 1
+ num_closed_issues: 1
+ num_pulls: 0
+ num_closed_pulls: 0
diff --git a/models/fixtures/user.yml b/models/fixtures/user.yml
new file mode 100644
index 0000000000..8847fc7aaa
--- /dev/null
+++ b/models/fixtures/user.yml
@@ -0,0 +1,25 @@
+- # NOTE: this user (id=1) is the admin
+ id: 1
+ lower_name: user1
+ name: user1
+ email: user1@example.com
+ passwd: password
+ type: 0 # individual
+ salt: salt
+ is_admin: true
+ avatar: avatar1
+ avatar_email: user2@example.com
+ num_repos: 0
+
+-
+ id: 2
+ lower_name: user2
+ name: user2
+ email: user2@example.com
+ passwd: password
+ type: 0 # individual
+ salt: salt
+ is_admin: false
+ avatar: avatar2
+ avatar_email: user2@example.com
+ num_repos: 2