summaryrefslogtreecommitdiffstats
path: root/store/sql_user_store_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-11-24 09:08:46 -0500
committerChristopher Speller <crspeller@gmail.com>2016-11-24 09:08:46 -0500
commitc96ecae6da31aceabf29586cde872876b81d11d9 (patch)
tree94df09df540da846bb4c6ed50e8bd7879cff63ba /store/sql_user_store_test.go
parentb212acf312ad640455fa715427ac19e6930dc61d (diff)
parent36f62c9e82350f58c902f64a5d3304872431ad41 (diff)
downloadchat-c96ecae6da31aceabf29586cde872876b81d11d9.tar.gz
chat-c96ecae6da31aceabf29586cde872876b81d11d9.tar.bz2
chat-c96ecae6da31aceabf29586cde872876b81d11d9.zip
Merge branch 'release-3.5'
Diffstat (limited to 'store/sql_user_store_test.go')
-rw-r--r--store/sql_user_store_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/store/sql_user_store_test.go b/store/sql_user_store_test.go
index e58e1fe40..acd87a036 100644
--- a/store/sql_user_store_test.go
+++ b/store/sql_user_store_test.go
@@ -981,6 +981,32 @@ func TestUserStoreSearch(t *testing.T) {
}
}
+ // * should be treated as a space
+ if r1 := <-store.User().Search(tid, "jimb*", searchOptions); r1.Err != nil {
+ t.Fatal(r1.Err)
+ } else {
+ profiles := r1.Data.([]*model.User)
+ found1 := false
+ found2 := false
+ for _, profile := range profiles {
+ if profile.Id == u1.Id {
+ found1 = true
+ }
+
+ if profile.Id == u3.Id {
+ found2 = true
+ }
+ }
+
+ if !found1 {
+ t.Fatal("should have found user")
+ }
+
+ if found2 {
+ t.Fatal("should not have found inactive user")
+ }
+ }
+
if r1 := <-store.User().Search(tid, "harol", searchOptions); r1.Err != nil {
t.Fatal(r1.Err)
} else {