Skip to content

Commit

Permalink
Merge pull request go-gitea#1874 from ethantkoenig/typo/issue_test
Browse files Browse the repository at this point in the history
Fix misspelled variables
  • Loading branch information
andreynering authored Jun 4, 2017
2 parents 858126b + 1a09afc commit ed31dff
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions models/issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,23 @@ func TestGetIssuesByIDs(t *testing.T) {
}

func TestGetParticipantsByIssueID(t *testing.T) {

assert.NoError(t, PrepareTestDatabase())

checkPartecipants := func(issueID int64, userIDs []int) {
partecipants, err := GetParticipantsByIssueID(issueID)
checkParticipants := func(issueID int64, userIDs []int) {
participants, err := GetParticipantsByIssueID(issueID)
if assert.NoError(t, err) {
partecipantsIDs := make([]int, len(partecipants))
for i, u := range partecipants {
partecipantsIDs[i] = int(u.ID)
participantsIDs := make([]int, len(participants))
for i, u := range participants {
participantsIDs[i] = int(u.ID)
}
sort.Ints(partecipantsIDs)
sort.Ints(participantsIDs)
sort.Ints(userIDs)
assert.Equal(t, userIDs, partecipantsIDs)
assert.Equal(t, userIDs, participantsIDs)
}

}

// User 1 is issue1 poster (see fixtures/issue.yml)
// User 2 only labeled issue1 (see fixtures/comment.yml)
// Users 3 and 5 made actual comments (see fixtures/comment.yml)
checkPartecipants(1, []int{3, 5})

checkParticipants(1, []int{3, 5})
}

0 comments on commit ed31dff

Please sign in to comment.