From dfc6db737411bd4ad68a803be5182f06055a1769 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Mon, 10 Apr 2017 08:19:49 -0400 Subject: 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 --- model/switch_request_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 model/switch_request_test.go (limited to 'model/switch_request_test.go') 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") + } +} -- cgit v1.2.3-1-g7c22