summaryrefslogtreecommitdiffstats
path: root/model/cluster_stats_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/cluster_stats_test.go')
-rw-r--r--model/cluster_stats_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/model/cluster_stats_test.go b/model/cluster_stats_test.go
new file mode 100644
index 000000000..13920b5d1
--- /dev/null
+++ b/model/cluster_stats_test.go
@@ -0,0 +1,19 @@
+// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+package model
+
+import (
+ "strings"
+ "testing"
+)
+
+func TestClusterStatsJson(t *testing.T) {
+ cluster := ClusterStats{Id: NewId(), TotalWebsocketConnections: 1, TotalReadDbConnections: 1}
+ json := cluster.ToJson()
+ result := ClusterStatsFromJson(strings.NewReader(json))
+
+ if cluster.Id != result.Id {
+ t.Fatal("Ids do not match")
+ }
+}