summaryrefslogtreecommitdiffstats
path: root/model/switch_request_test.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-04-10 08:19:49 -0400
committerChristopher Speller <crspeller@gmail.com>2017-04-10 08:19:49 -0400
commitdfc6db737411bd4ad68a803be5182f06055a1769 (patch)
tree375d93b8d1d8b1384988dc708c9f337e0ea2366c /model/switch_request_test.go
parent7b77bcf87e85330a1f7f0b2a2dcbf71326bf2fba (diff)
downloadchat-dfc6db737411bd4ad68a803be5182f06055a1769.tar.gz
chat-dfc6db737411bd4ad68a803be5182f06055a1769.tar.bz2
chat-dfc6db737411bd4ad68a803be5182f06055a1769.zip
Refactor switching login type code into app layer and add v4 endpoint (#6000)
* Refactor switching login type code into app layer and add v4 endpoint * Fix unit test
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")
+ }
+}