summaryrefslogtreecommitdiffstats
path: root/store/sql_session_store_test.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-09-23 12:49:28 -0700
committer=Corey Hulen <corey@hulen.com>2015-09-23 12:49:28 -0700
commit1626a6de6f16ba0878160b0a7eae9f49b8d34d4f (patch)
treeabc9088402a783c2e1908fb2db93ad84731827dd /store/sql_session_store_test.go
parent9e04909c0a3672d27c148c931d82b225cc86dfe5 (diff)
downloadchat-1626a6de6f16ba0878160b0a7eae9f49b8d34d4f.tar.gz
chat-1626a6de6f16ba0878160b0a7eae9f49b8d34d4f.tar.bz2
chat-1626a6de6f16ba0878160b0a7eae9f49b8d34d4f.zip
PLT-349 adding team mgt to admin console
Diffstat (limited to 'store/sql_session_store_test.go')
-rw-r--r--store/sql_session_store_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/store/sql_session_store_test.go b/store/sql_session_store_test.go
index 4ae680556..3d8aafe25 100644
--- a/store/sql_session_store_test.go
+++ b/store/sql_session_store_test.go
@@ -80,6 +80,29 @@ func TestSessionRemove(t *testing.T) {
}
}
+func TestSessionRemoveAll(t *testing.T) {
+ Setup()
+
+ s1 := model.Session{}
+ s1.UserId = model.NewId()
+ s1.TeamId = model.NewId()
+ Must(store.Session().Save(&s1))
+
+ if rs1 := (<-store.Session().Get(s1.Id)); rs1.Err != nil {
+ t.Fatal(rs1.Err)
+ } else {
+ if rs1.Data.(*model.Session).Id != s1.Id {
+ t.Fatal("should match")
+ }
+ }
+
+ Must(store.Session().RemoveAllSessionsForTeam(s1.TeamId))
+
+ if rs2 := (<-store.Session().Get(s1.Id)); rs2.Err == nil {
+ t.Fatal("should have been removed")
+ }
+}
+
func TestSessionRemoveToken(t *testing.T) {
Setup()