summaryrefslogtreecommitdiffstats
path: root/store/sql_user_store_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-04-17 15:08:56 -0400
committerChristopher Speller <crspeller@gmail.com>2017-04-17 15:08:56 -0400
commit92d8fa4aa8af170d0018baed94a8787d06297e44 (patch)
treedc5000a3584952c797c03bf4331282a5e1536848 /store/sql_user_store_test.go
parent742bab6429aeb1b581275da3c06af99fe293baab (diff)
parent30974533941e73f102505d07badf538cfdbbf3fc (diff)
downloadchat-92d8fa4aa8af170d0018baed94a8787d06297e44.tar.gz
chat-92d8fa4aa8af170d0018baed94a8787d06297e44.tar.bz2
chat-92d8fa4aa8af170d0018baed94a8787d06297e44.zip
Merge branch 'release-3.8'
Diffstat (limited to 'store/sql_user_store_test.go')
-rw-r--r--store/sql_user_store_test.go38
1 files changed, 38 insertions, 0 deletions
diff --git a/store/sql_user_store_test.go b/store/sql_user_store_test.go
index 700a0e1d7..94fd30a6f 100644
--- a/store/sql_user_store_test.go
+++ b/store/sql_user_store_test.go
@@ -1659,6 +1659,44 @@ func TestUserStoreSearch(t *testing.T) {
t.Fatal("should not have found user")
}
}
+
+ // Check SearchNotInTeam finds previously deleted team members.
+ Must(store.Team().SaveMember(&model.TeamMember{TeamId: tid, UserId: u4.Id}))
+
+ if r1 := <-store.User().SearchNotInTeam(tid, "simo", searchOptions); r1.Err != nil {
+ t.Fatal(r1.Err)
+ } else {
+ profiles := r1.Data.([]*model.User)
+ found := false
+ for _, profile := range profiles {
+ if profile.Id == u4.Id {
+ found = true
+ break
+ }
+ }
+
+ if found {
+ t.Fatal("should not have found user")
+ }
+ }
+
+ Must(store.Team().UpdateMember(&model.TeamMember{TeamId: tid, UserId: u4.Id, DeleteAt: model.GetMillis() - 1000}))
+ if r1 := <-store.User().SearchNotInTeam(tid, "simo", searchOptions); r1.Err != nil {
+ t.Fatal(r1.Err)
+ } else {
+ profiles := r1.Data.([]*model.User)
+ found := false
+ for _, profile := range profiles {
+ if profile.Id == u4.Id {
+ found = true
+ break
+ }
+ }
+
+ if !found {
+ t.Fatal("should have found user")
+ }
+ }
}
func TestUserStoreSearchWithoutTeam(t *testing.T) {