Hide unactive on explore users and some refactors (#2741)

* hide unactive on explore users and some refactors

* fix test for removed Organizations

* fix test for removed Organizations

* fix imports

* fix logic bug

* refactor the toConds

* Rename TestOrganizations to TestSearchUsers and add tests for users

* fix other tests

* fix other tests

* fix watchers tests

* fix comments and remove unused code
This commit is contained in:
Lunny Xiao 2017-10-25 01:36:19 +08:00 committed by Lauris BH
parent 03900303a9
commit 6eeadb2082
15 changed files with 143 additions and 151 deletions

View file

@ -16,10 +16,13 @@ func TestCreateOrUpdateIssueNotifications(t *testing.T) {
assert.NoError(t, CreateOrUpdateIssueNotifications(issue, 2))
// Two watchers are inactive, thus only notification for user 10 is created
notf := AssertExistsAndLoadBean(t, &Notification{UserID: 10, IssueID: issue.ID}).(*Notification)
// User 9 is inactive, thus notifications for user 1 and 4 are created
notf := AssertExistsAndLoadBean(t, &Notification{UserID: 1, IssueID: issue.ID}).(*Notification)
assert.Equal(t, NotificationStatusUnread, notf.Status)
CheckConsistencyFor(t, &Issue{ID: issue.ID})
notf = AssertExistsAndLoadBean(t, &Notification{UserID: 4, IssueID: issue.ID}).(*Notification)
assert.Equal(t, NotificationStatusUnread, notf.Status)
}
func TestNotificationsForUser(t *testing.T) {