summaryrefslogtreecommitdiffstats
path: root/store/sql_session_store_test.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-11-15 18:18:02 -0800
committer=Corey Hulen <corey@hulen.com>2015-11-16 11:34:29 -0800
commit03c6dcbd865e2af2db5db150189504bfa493ae2e (patch)
tree360d2ece83de79d3df338d581216e4282b420209 /store/sql_session_store_test.go
parent48d2f86b90b3e0b02cb28f3e8b6e4d454f9cb869 (diff)
downloadchat-03c6dcbd865e2af2db5db150189504bfa493ae2e.tar.gz
chat-03c6dcbd865e2af2db5db150189504bfa493ae2e.tar.bz2
chat-03c6dcbd865e2af2db5db150189504bfa493ae2e.zip
PLT-975 adding perm deletes
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 068e5fc19..a06a2bdff 100644
--- a/store/sql_session_store_test.go
+++ b/store/sql_session_store_test.go
@@ -103,6 +103,29 @@ func TestSessionRemoveAll(t *testing.T) {
}
}
+func TestSessionRemoveByUser(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().RemoveAllSessionsForUser(s1.UserId))
+
+ if rs2 := (<-store.Session().Get(s1.Id)); rs2.Err == nil {
+ t.Fatal("should have been removed")
+ }
+}
+
func TestSessionRemoveToken(t *testing.T) {
Setup()