PLT-2241 Refactored statuses into a more real-time system (#3573)

* Refactored statuses into a more real-time system

* Updated package.json with correct commit and fixed minor bug

* Minor updates to statuses based on feedback

* When setting status online, update only LastActivityAt if status already exists
Этот коммит содержится в:
Joram Wilander
2016-07-18 11:10:03 -04:00
коммит произвёл GitHub
родитель 180adc79af
Коммит c0ab2636d6
35 изменённых файлов: 800 добавлений и 376 удалений

27
model/status_test.go Обычный файл
Просмотреть файл

@@ -0,0 +1,27 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package model
import (
"strings"
"testing"
)
func TestStatus(t *testing.T) {
status := Status{NewId(), STATUS_ONLINE, 0}
json := status.ToJson()
status2 := StatusFromJson(strings.NewReader(json))
if status.UserId != status2.UserId {
t.Fatal("UserId should have matched")
}
if status.Status != status2.Status {
t.Fatal("Status should have matched")
}
if status.LastActivityAt != status2.LastActivityAt {
t.Fatal("LastActivityAt should have matched")
}
}