diff options
author | Morlinest <Morlinest@users.noreply.github.com> | 2017-08-28 11:17:45 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2017-08-28 12:17:45 +0300 |
commit | 8e61823ec403b661359373f8f8b0c9a7c9ea368d (patch) | |
tree | 0ee6d56bf3f1c01348afa2a2f03dfbd6f72815de /models/notification_test.go | |
parent | ced50e0ec13085504fa19c82f018a2eecb70ff68 (diff) | |
download | gitea-8e61823ec403b661359373f8f8b0c9a7c9ea368d.tar.gz gitea-8e61823ec403b661359373f8f8b0c9a7c9ea368d.zip |
Fix tests code to prevent some runtime errors (#2381)
* Fix tests code to prevent some runtime errors
* Reduce nesting
Diffstat (limited to 'models/notification_test.go')
-rw-r--r-- | models/notification_test.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/models/notification_test.go b/models/notification_test.go index 57d686a474..2166afa2a6 100644 --- a/models/notification_test.go +++ b/models/notification_test.go @@ -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) { |