aboutsummaryrefslogtreecommitdiffstats
path: root/models/notification_test.go
diff options
context:
space:
mode:
authorNorwin <noerw@users.noreply.github.com>2021-09-18 01:40:50 +0200
committerGitHub <noreply@github.com>2021-09-17 19:40:50 -0400
commit0ffad31b9285044fc8a2b424a1fe65522cc287d6 (patch)
treeb4d183480410296505ddcae1da722b6728bdc0a3 /models/notification_test.go
parentba2e600d17bab8870f4ab33eb5816dff19a060c3 (diff)
downloadgitea-0ffad31b9285044fc8a2b424a1fe65522cc287d6.tar.gz
gitea-0ffad31b9285044fc8a2b424a1fe65522cc287d6.zip
Notifications API: respond with updated notifications (#17064)
* notifications api: return updated notifications in response * make generate-swagger * openapi fix Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'models/notification_test.go')
-rw-r--r--models/notification_test.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/models/notification_test.go b/models/notification_test.go
index 07b9f97de5..440b6ed4c6 100644
--- a/models/notification_test.go
+++ b/models/notification_test.go
@@ -76,12 +76,15 @@ func TestSetNotificationStatus(t *testing.T) {
user := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
notf := AssertExistsAndLoadBean(t,
&Notification{UserID: user.ID, Status: NotificationStatusRead}).(*Notification)
- assert.NoError(t, SetNotificationStatus(notf.ID, user, NotificationStatusPinned))
+ _, err := SetNotificationStatus(notf.ID, user, NotificationStatusPinned)
+ assert.NoError(t, err)
AssertExistsAndLoadBean(t,
&Notification{ID: notf.ID, Status: NotificationStatusPinned})
- assert.Error(t, SetNotificationStatus(1, user, NotificationStatusRead))
- assert.Error(t, SetNotificationStatus(NonexistentID, user, NotificationStatusRead))
+ _, err = SetNotificationStatus(1, user, NotificationStatusRead)
+ assert.Error(t, err)
+ _, err = SetNotificationStatus(NonexistentID, user, NotificationStatusRead)
+ assert.Error(t, err)
}
func TestUpdateNotificationStatuses(t *testing.T) {