Deauthenticate websockets and set status to offline when user account deactivated (#4551)

Этот коммит содержится в:
Joram Wilander
2016-11-15 10:38:58 -05:00
коммит произвёл enahum
родитель 526c392aad
Коммит 9c36ca9aca
4 изменённых файлов: 38 добавлений и 5 удалений

Просмотреть файл

@@ -1133,8 +1133,9 @@ func TestUserUpdateDeviceId(t *testing.T) {
}
func TestUserUpdateActive(t *testing.T) {
th := Setup()
th := Setup().InitSystemAdmin()
Client := th.CreateClient()
SystemAdminClient := th.SystemAdminClient
team := &model.Team{DisplayName: "Name", Name: "z-z-" + model.NewId() + "a", Email: "test@nowhere.com", Type: model.TEAM_OPEN}
team = Client.Must(Client.CreateTeam(team)).Data.(*model.Team)
@@ -1187,6 +1188,18 @@ func TestUserUpdateActive(t *testing.T) {
if _, err := Client.UpdateActive("12345678901234567890123456", false); err == nil {
t.Fatal("Should have errored, bad id")
}
SetStatusOnline(user3.Id, "", false)
if _, err := SystemAdminClient.UpdateActive(user3.Id, false); err != nil {
t.Fatal(err)
}
if status, err := GetStatus(user3.Id); err != nil {
t.Fatal(err)
} else if status.Status != model.STATUS_OFFLINE {
t.Fatal("status should have been set to offline")
}
}
func TestUserPermDelete(t *testing.T) {