|
|
|
@ -23,6 +23,7 @@ func TestChangeMilestoneAssign(t *testing.T) { |
|
|
|
|
|
|
|
|
|
oldMilestoneID := issue.MilestoneID |
|
|
|
|
issue.MilestoneID = 2 |
|
|
|
|
assert.NoError(t, issue.LoadMilestone(db.DefaultContext)) |
|
|
|
|
assert.NoError(t, ChangeMilestoneAssign(db.DefaultContext, issue, doer, oldMilestoneID)) |
|
|
|
|
unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ |
|
|
|
|
IssueID: issue.ID, |
|
|
|
@ -31,4 +32,11 @@ func TestChangeMilestoneAssign(t *testing.T) { |
|
|
|
|
OldMilestoneID: oldMilestoneID, |
|
|
|
|
}) |
|
|
|
|
unittest.CheckConsistencyFor(t, &issues_model.Milestone{}, &issues_model.Issue{}) |
|
|
|
|
assert.NotNil(t, issue.Milestone) |
|
|
|
|
|
|
|
|
|
oldMilestoneID = issue.MilestoneID |
|
|
|
|
issue.MilestoneID = 0 |
|
|
|
|
assert.NoError(t, ChangeMilestoneAssign(db.DefaultContext, issue, doer, oldMilestoneID)) |
|
|
|
|
assert.EqualValues(t, 0, issue.MilestoneID) |
|
|
|
|
assert.Nil(t, issue.Milestone) |
|
|
|
|
} |
|
|
|
|