summaryrefslogtreecommitdiffstats
path: root/models/issue_milestone_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-10-07 05:26:19 +0800
committertechknowlogick <techknowlogick@gitea.io>2019-10-06 17:26:19 -0400
commit51fade4c44c3517923cd07783ab05a55aaa84dcd (patch)
tree8f7b745489bd677a74a779c273cc786b0f479900 /models/issue_milestone_test.go
parentbc5a479fefa77ee54a9fddecdbbb7e7991f22da1 (diff)
downloadgitea-51fade4c44c3517923cd07783ab05a55aaa84dcd.tar.gz
gitea-51fade4c44c3517923cd07783ab05a55aaa84dcd.zip
Fix milestone num_issues (#8221)
* fix milestone num_issues * update missing completeness * only update milestone closed number when closed issue is assigned a new milestone or clear milestone * fix tests * fix update milestone num * fix completeness calculate * make completeness calucation more clear
Diffstat (limited to 'models/issue_milestone_test.go')
-rw-r--r--models/issue_milestone_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/models/issue_milestone_test.go b/models/issue_milestone_test.go
index 09c6ff7595..6f8548ec67 100644
--- a/models/issue_milestone_test.go
+++ b/models/issue_milestone_test.go
@@ -231,7 +231,7 @@ func TestChangeMilestoneStatus(t *testing.T) {
CheckConsistencyFor(t, &Repository{ID: milestone.RepoID}, &Milestone{})
}
-func TestChangeMilestoneIssueStats(t *testing.T) {
+func TestUpdateMilestoneClosedNum(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())
issue := AssertExistsAndLoadBean(t, &Issue{MilestoneID: 1},
"is_closed=0").(*Issue)
@@ -240,14 +240,14 @@ func TestChangeMilestoneIssueStats(t *testing.T) {
issue.ClosedUnix = timeutil.TimeStampNow()
_, err := x.Cols("is_closed", "closed_unix").Update(issue)
assert.NoError(t, err)
- assert.NoError(t, changeMilestoneIssueStats(x.NewSession(), issue))
+ assert.NoError(t, updateMilestoneClosedNum(x, issue.MilestoneID))
CheckConsistencyFor(t, &Milestone{})
issue.IsClosed = false
issue.ClosedUnix = 0
_, err = x.Cols("is_closed", "closed_unix").Update(issue)
assert.NoError(t, err)
- assert.NoError(t, changeMilestoneIssueStats(x.NewSession(), issue))
+ assert.NoError(t, updateMilestoneClosedNum(x, issue.MilestoneID))
CheckConsistencyFor(t, &Milestone{})
}