mirror of
https://github.com/go-gitea/gitea
synced 2024-12-25 15:05:57 +01:00
gofmt
Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
parent
bc9359222a
commit
58fb672d0d
@ -818,7 +818,7 @@ func fetchCodeComments(e Engine, issue *Issue, currentUser *User) (map[string]ma
|
|||||||
// If the review is pending only the author can see the comments
|
// If the review is pending only the author can see the comments
|
||||||
if re.Type == ReviewTypePending &&
|
if re.Type == ReviewTypePending &&
|
||||||
(currentUser == nil || currentUser.ID != re.ReviewerID) {
|
(currentUser == nil || currentUser.ID != re.ReviewerID) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
comment.Review = re
|
comment.Review = re
|
||||||
}
|
}
|
||||||
|
@ -53,8 +53,8 @@ func TestReviewType_Icon(t *testing.T) {
|
|||||||
func TestFindReviews(t *testing.T) {
|
func TestFindReviews(t *testing.T) {
|
||||||
assert.NoError(t, PrepareTestDatabase())
|
assert.NoError(t, PrepareTestDatabase())
|
||||||
reviews, err := FindReviews(FindReviewOptions{
|
reviews, err := FindReviews(FindReviewOptions{
|
||||||
Type: ReviewTypeApprove,
|
Type: ReviewTypeApprove,
|
||||||
IssueID: 2,
|
IssueID: 2,
|
||||||
ReviewerID: 1,
|
ReviewerID: 1,
|
||||||
})
|
})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
@ -71,7 +71,7 @@ func TestGetCurrentReview(t *testing.T) {
|
|||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.NotNil(t, review)
|
assert.NotNil(t, review)
|
||||||
assert.Equal(t, ReviewTypePending, review.Type)
|
assert.Equal(t, ReviewTypePending, review.Type)
|
||||||
assert.Equal(t, "Pending Review", review.Content )
|
assert.Equal(t, "Pending Review", review.Content)
|
||||||
|
|
||||||
user2 := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
|
user2 := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
|
||||||
review2, err := GetCurrentReview(user2, issue)
|
review2, err := GetCurrentReview(user2, issue)
|
||||||
@ -87,9 +87,9 @@ func TestCreateReview(t *testing.T) {
|
|||||||
user := AssertExistsAndLoadBean(t, &User{ID: 1}).(*User)
|
user := AssertExistsAndLoadBean(t, &User{ID: 1}).(*User)
|
||||||
|
|
||||||
review, err := CreateReview(CreateReviewOptions{
|
review, err := CreateReview(CreateReviewOptions{
|
||||||
Content: "New Review",
|
Content: "New Review",
|
||||||
Type: ReviewTypePending,
|
Type: ReviewTypePending,
|
||||||
Issue: issue,
|
Issue: issue,
|
||||||
Reviewer: user,
|
Reviewer: user,
|
||||||
})
|
})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user