PLT-975 adding perm deletes
Этот коммит содержится в:
@@ -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()
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user