diff options
Diffstat (limited to 'store/sql_user_store_test.go')
-rw-r--r-- | store/sql_user_store_test.go | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/store/sql_user_store_test.go b/store/sql_user_store_test.go index e2a454023..be21c8bd2 100644 --- a/store/sql_user_store_test.go +++ b/store/sql_user_store_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. package store @@ -259,6 +259,29 @@ func TestUserStoreGetProfiles(t *testing.T) { } } +func TestUserStoreGetSystemAdminProfiles(t *testing.T) { + Setup() + + u1 := model.User{} + u1.TeamId = model.NewId() + u1.Email = model.NewId() + Must(store.User().Save(&u1)) + + u2 := model.User{} + u2.TeamId = u1.TeamId + u2.Email = model.NewId() + Must(store.User().Save(&u2)) + + if r1 := <-store.User().GetSystemAdminProfiles(); r1.Err != nil { + t.Fatal(r1.Err) + } else { + users := r1.Data.(map[string]*model.User) + if len(users) <= 0 { + t.Fatal("invalid returned system admin users") + } + } +} + func TestUserStoreGetByEmail(t *testing.T) { Setup() |