summaryrefslogtreecommitdiffstats
path: root/model/switch_request_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/switch_request_test.go')
-rw-r--r--model/switch_request_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/model/switch_request_test.go b/model/switch_request_test.go
new file mode 100644
index 000000000..b85846f78
--- /dev/null
+++ b/model/switch_request_test.go
@@ -0,0 +1,19 @@
+// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+package model
+
+import (
+ "strings"
+ "testing"
+)
+
+func TestSwitchRequestJson(t *testing.T) {
+ o := SwitchRequest{Email: NewId(), Password: NewId()}
+ json := o.ToJson()
+ ro := SwitchRequestFromJson(strings.NewReader(json))
+
+ if o.Email != ro.Email {
+ t.Fatal("Emails do not match")
+ }
+}