summaryrefslogtreecommitdiffstats
path: root/models/notification_test.go
diff options
context:
space:
mode:
authorDavid Schneiderbauer <daviian@users.noreply.github.com>2017-09-16 02:18:25 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2017-09-16 08:18:25 +0800
commitd766d0c4e064bf7f66098123f39d15c2dc67e415 (patch)
tree274eebecadd724502dd5c82e95f2f6f4cc4d6d34 /models/notification_test.go
parentb496e3e1cc70829e5a6f78f3dff28277993f8406 (diff)
downloadgitea-d766d0c4e064bf7f66098123f39d15c2dc67e415.tar.gz
gitea-d766d0c4e064bf7f66098123f39d15c2dc67e415.zip
Prevent sending emails and notifications to inactive users (#2384)
* Filter inactive users before sending emails or creating browser notifications Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com> * fix formatting issues Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com> * included requested changes Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com> * optimized database queries * rebasing new master and add tablenames for clarification in xorm queries * remove escaped quotationmarks using backticks Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
Diffstat (limited to 'models/notification_test.go')
-rw-r--r--models/notification_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/models/notification_test.go b/models/notification_test.go
index 2166afa2a6..c1b7d50529 100644
--- a/models/notification_test.go
+++ b/models/notification_test.go
@@ -16,9 +16,8 @@ func TestCreateOrUpdateIssueNotifications(t *testing.T) {
assert.NoError(t, CreateOrUpdateIssueNotifications(issue, 2))
- notf := AssertExistsAndLoadBean(t, &Notification{UserID: 1, IssueID: issue.ID}).(*Notification)
- assert.Equal(t, NotificationStatusUnread, notf.Status)
- notf = AssertExistsAndLoadBean(t, &Notification{UserID: 4, IssueID: issue.ID}).(*Notification)
+ // Two watchers are inactive, thus only notification for user 10 is created
+ notf := AssertExistsAndLoadBean(t, &Notification{UserID: 10, IssueID: issue.ID}).(*Notification)
assert.Equal(t, NotificationStatusUnread, notf.Status)
CheckConsistencyFor(t, &Issue{ID: issue.ID})
}