summaryrefslogtreecommitdiffstats
path: root/store/sql_team_store_test.go
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2016-02-25 12:32:46 -0500
committerJoramWilander <jwawilander@gmail.com>2016-03-01 10:46:30 -0500
commit8239c68cf323e4bb20007d2b456336becead273d (patch)
tree3422ed0946afafa47d6649e09f6f09ee71692363 /store/sql_team_store_test.go
parent8aa4e28932ec43090ca6b481929fafbe0119a660 (diff)
downloadchat-8239c68cf323e4bb20007d2b456336becead273d.tar.gz
chat-8239c68cf323e4bb20007d2b456336becead273d.tar.bz2
chat-8239c68cf323e4bb20007d2b456336becead273d.zip
Refactor and modularize analytics on the client
Diffstat (limited to 'store/sql_team_store_test.go')
-rw-r--r--store/sql_team_store_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/store/sql_team_store_test.go b/store/sql_team_store_test.go
index 7dc31cbe2..743ef053f 100644
--- a/store/sql_team_store_test.go
+++ b/store/sql_team_store_test.go
@@ -261,3 +261,23 @@ func TestDelete(t *testing.T) {
t.Fatal(r1.Err)
}
}
+
+func TestTeamCount(t *testing.T) {
+ Setup()
+
+ o1 := model.Team{}
+ o1.DisplayName = "DisplayName"
+ o1.Name = "a" + model.NewId() + "b"
+ o1.Email = model.NewId() + "@nowhere.com"
+ o1.Type = model.TEAM_OPEN
+ o1.AllowTeamListing = true
+ Must(store.Team().Save(&o1))
+
+ if r1 := <-store.Team().AnalyticsTeamCount(); r1.Err != nil {
+ t.Fatal(r1.Err)
+ } else {
+ if r1.Data.(int64) == 0 {
+ t.Fatal("should be at least 1 team")
+ }
+ }
+}