summaryrefslogtreecommitdiffstats
path: root/model/status_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/status_test.go')
-rw-r--r--model/status_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/model/status_test.go b/model/status_test.go
new file mode 100644
index 000000000..ccdac53b6
--- /dev/null
+++ b/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")
+ }
+}