aboutsummaryrefslogtreecommitdiffstats
path: root/models/issues/comment_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/issues/comment_test.go')
-rw-r--r--models/issues/comment_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/models/issues/comment_test.go b/models/issues/comment_test.go
index 32b86891e8..ae0bc3ce17 100644
--- a/models/issues/comment_test.go
+++ b/models/issues/comment_test.go
@@ -115,3 +115,12 @@ func TestMigrate_InsertIssueComments(t *testing.T) {
unittest.CheckConsistencyFor(t, &issues_model.Issue{})
}
+
+func Test_UpdateIssueNumComments(t *testing.T) {
+ assert.NoError(t, unittest.PrepareTestDatabase())
+ issue2 := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 2})
+
+ assert.NoError(t, issues_model.UpdateIssueNumComments(db.DefaultContext, issue2.ID))
+ issue2 = unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 2})
+ assert.EqualValues(t, 1, issue2.NumComments)
+}