1
0
Fork 0
forked from forgejo/forgejo

Fix tests code to prevent some runtime errors (#2381)

* Fix tests code to prevent some runtime errors

* Reduce nesting
This commit is contained in:
Morlinest 2017-08-28 11:17:45 +02:00 committed by Lauris BH
parent ced50e0ec1
commit 8e61823ec4
15 changed files with 181 additions and 150 deletions

View file

@ -29,9 +29,10 @@ func TestNotificationsForUser(t *testing.T) {
statuses := []NotificationStatus{NotificationStatusRead, NotificationStatusUnread}
notfs, err := NotificationsForUser(user, statuses, 1, 10)
assert.NoError(t, err)
assert.Len(t, notfs, 1)
assert.EqualValues(t, 2, notfs[0].ID)
assert.EqualValues(t, user.ID, notfs[0].UserID)
if assert.Len(t, notfs, 1) {
assert.EqualValues(t, 2, notfs[0].ID)
assert.EqualValues(t, user.ID, notfs[0].UserID)
}
}
func TestNotification_GetRepo(t *testing.T) {