summaryrefslogtreecommitdiffstats
path: root/models/review_test.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-05-02 02:20:51 +0200
committerGitHub <noreply@github.com>2020-05-02 03:20:51 +0300
commitc97494a4f4a0e8ba5453e293bcebb76274062b99 (patch)
tree29511446fbdc0296f77390a6566d4ad1eef4668c /models/review_test.go
parent4ed7d2a2bbb421e37cc0bc23a9f997e5606258ea (diff)
downloadgitea-c97494a4f4a0e8ba5453e293bcebb76274062b99.tar.gz
gitea-c97494a4f4a0e8ba5453e293bcebb76274062b99.zip
API: Add pull review endpoints (#11224)
* API: Added pull review read only endpoints * Update Structs, move Conversion, Refactor * refactor * lint & co * fix lint + refactor * add new Review state, rm unessesary, refacotr loadAttributes, convert patch to diff * add DeletePullReview * add paggination * draft1: Create & submit review * fix lint * fix lint * impruve test * DONT use GhostUser for loadReviewer * expose comments_count of a PullReview * infent GetCodeCommentsCount() * fixes * fix+impruve * some nits * Handle Ghosts :ghost: * add TEST for GET apis * complete TESTS * add HTMLURL to PullReview responce * code format as per @lafriks * update swagger definition * Update routers/api/v1/repo/pull_review.go Co-authored-by: David Svantesson <davidsvantesson@gmail.com> * add comments Co-authored-by: Thomas Berger <loki@lokis-chaos.de> Co-authored-by: David Svantesson <davidsvantesson@gmail.com>
Diffstat (limited to 'models/review_test.go')
-rw-r--r--models/review_test.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/models/review_test.go b/models/review_test.go
index 45ddb3181d..fb3a5488e5 100644
--- a/models/review_test.go
+++ b/models/review_test.go
@@ -131,9 +131,11 @@ func TestGetReviewersByIssueID(t *testing.T) {
allReviews, err := GetReviewersByIssueID(issue.ID)
assert.NoError(t, err)
- for i, review := range allReviews {
- assert.Equal(t, expectedReviews[i].Reviewer, review.Reviewer)
- assert.Equal(t, expectedReviews[i].Type, review.Type)
- assert.Equal(t, expectedReviews[i].UpdatedUnix, review.UpdatedUnix)
+ if assert.Len(t, allReviews, 3) {
+ for i, review := range allReviews {
+ assert.Equal(t, expectedReviews[i].Reviewer, review.Reviewer)
+ assert.Equal(t, expectedReviews[i].Type, review.Type)
+ assert.Equal(t, expectedReviews[i].UpdatedUnix, review.UpdatedUnix)
+ }
}
}