summaryrefslogtreecommitdiffstats
path: root/store/sql_user_store_test.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-05-04 06:31:42 -0700
committerChristopher Speller <crspeller@gmail.com>2016-05-04 09:31:42 -0400
commit6611229cd7bd3cdfc0082c0a581145aaac0ab322 (patch)
treedb6670a8c2716179bfe6e07b82588d83d3afb6bd /store/sql_user_store_test.go
parent6b06f49e8910ed44f619adad15ab268758312852 (diff)
downloadchat-6611229cd7bd3cdfc0082c0a581145aaac0ab322.tar.gz
chat-6611229cd7bd3cdfc0082c0a581145aaac0ab322.tar.bz2
chat-6611229cd7bd3cdfc0082c0a581145aaac0ab322.zip
PLT-2707 Adding option to show DM list from all of server (#2871)
* PLT-2707 Adding option to show DM list from all of server * Fixing loc
Diffstat (limited to 'store/sql_user_store_test.go')
-rw-r--r--store/sql_user_store_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/store/sql_user_store_test.go b/store/sql_user_store_test.go
index fbe2285a9..b48da55f5 100644
--- a/store/sql_user_store_test.go
+++ b/store/sql_user_store_test.go
@@ -263,6 +263,31 @@ func TestActiveUserCount(t *testing.T) {
}
}
+func TestUserStoreGetAllProfiles(t *testing.T) {
+ Setup()
+
+ teamId := model.NewId()
+
+ u1 := &model.User{}
+ u1.Email = model.NewId()
+ Must(store.User().Save(u1))
+ Must(store.Team().SaveMember(&model.TeamMember{TeamId: teamId, UserId: u1.Id}))
+
+ u2 := &model.User{}
+ u2.Email = model.NewId()
+ Must(store.User().Save(u2))
+ Must(store.Team().SaveMember(&model.TeamMember{TeamId: teamId, UserId: u2.Id}))
+
+ if r1 := <-store.User().GetAllProfiles(); r1.Err != nil {
+ t.Fatal(r1.Err)
+ } else {
+ users := r1.Data.(map[string]*model.User)
+ if len(users) < 2 {
+ t.Fatal("invalid returned users")
+ }
+ }
+}
+
func TestUserStoreGetProfiles(t *testing.T) {
Setup()