summaryrefslogtreecommitdiffstats
path: root/models/notification_test.go
diff options
context:
space:
mode:
authorMorlinest <Morlinest@users.noreply.github.com>2017-08-28 11:17:45 +0200
committerLauris BH <lauris@nix.lv>2017-08-28 12:17:45 +0300
commit8e61823ec403b661359373f8f8b0c9a7c9ea368d (patch)
tree0ee6d56bf3f1c01348afa2a2f03dfbd6f72815de /models/notification_test.go
parentced50e0ec13085504fa19c82f018a2eecb70ff68 (diff)
downloadgitea-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.go7
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) {