summaryrefslogtreecommitdiffstats
path: root/model/status_test.go
blob: ccdac53b6d3863797de1162f5ce11b5252d00f1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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")
	}
}