summaryrefslogtreecommitdiffstats
path: root/models/issue_test.go
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-03-14 21:10:35 -0400
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2017-03-15 02:10:35 +0100
commit09fe4a2ae9dfa8b3bc8a5039d0feab1e1a34d07b (patch)
treed7c595f4b004e2bfe70fc363a8258b0b26cae41b /models/issue_test.go
parent021904e4e65804baa67b38e193e15aa37a391c60 (diff)
downloadgitea-09fe4a2ae9dfa8b3bc8a5039d0feab1e1a34d07b.tar.gz
gitea-09fe4a2ae9dfa8b3bc8a5039d0feab1e1a34d07b.zip
Batch updates for issues (#926)
Diffstat (limited to 'models/issue_test.go')
-rw-r--r--models/issue_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/models/issue_test.go b/models/issue_test.go
index a6da80917e..7c80258c2b 100644
--- a/models/issue_test.go
+++ b/models/issue_test.go
@@ -42,3 +42,19 @@ func TestIssueAPIURL(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, "https://try.gitea.io/api/v1/repos/user2/repo1/issues/1", issue.APIURL())
}
+
+func TestGetIssuesByIDs(t *testing.T) {
+ assert.NoError(t, PrepareTestDatabase())
+ testSuccess := func(expectedIssueIDs []int64, nonExistentIssueIDs []int64) {
+ issues, err := GetIssuesByIDs(append(expectedIssueIDs, nonExistentIssueIDs...))
+ assert.NoError(t, err)
+ actualIssueIDs := make([]int64, len(issues))
+ for i, issue := range issues {
+ actualIssueIDs[i] = issue.ID
+ }
+ assert.Equal(t, expectedIssueIDs, actualIssueIDs)
+
+ }
+ testSuccess([]int64{1, 2, 3}, []int64{})
+ testSuccess([]int64{1, 2, 3}, []int64{NonexistentID})
+}