Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed May 13, 2018
1 parent 09a7a4e commit a03e215
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions models/issue_milestone.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ func ChangeMilestoneAssign(issue *Issue, doer *User, oldMilestoneID int64) (err
hookAction = api.HookIssueDemilestoned
}

if err = issue.LoadAttributes(); err != nil {
return err
}

mode, _ := AccessLevel(doer.ID, issue.Repo)
if issue.IsPull {
err = issue.PullRequest.LoadIssue()
Expand Down
2 changes: 2 additions & 0 deletions models/issue_milestone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ func TestChangeMilestoneAssign(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())
issue := AssertExistsAndLoadBean(t, &Issue{RepoID: 1}).(*Issue)
doer := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
assert.NotNil(t, issue)
assert.NotNil(t, doer)

oldMilestoneID := issue.MilestoneID
issue.MilestoneID = 2
Expand Down
2 changes: 1 addition & 1 deletion models/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestWebhook_UpdateEvent(t *testing.T) {
}

func TestWebhook_EventsArray(t *testing.T) {
assert.Equal(t, []string{"create", "push", "pull_request"},
assert.Equal(t, []string{"create", "delete", "fork", "push", "issues", "issue_comment", "pull_request", "repository", "release"},
(&Webhook{
HookEvent: &HookEvent{SendEverything: true},
}).EventsArray(),
Expand Down

0 comments on commit a03e215

Please sign in to comment.