summaryrefslogtreecommitdiffstats
path: root/model/mfa_secret_test.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-03-27 09:21:48 -0400
committerGitHub <noreply@github.com>2017-03-27 09:21:48 -0400
commit58397f853a31773f24ad4e62dc1f34df0a975d53 (patch)
treec2055df17b6347199bf48054d606cf1b3b0e89c2 /model/mfa_secret_test.go
parenta0d5c01dfd97b45478353ccff777de677f088d0f (diff)
downloadchat-58397f853a31773f24ad4e62dc1f34df0a975d53.tar.gz
chat-58397f853a31773f24ad4e62dc1f34df0a975d53.tar.bz2
chat-58397f853a31773f24ad4e62dc1f34df0a975d53.zip
Implement some MFA endpoints for APIv4 (#5864)
Diffstat (limited to 'model/mfa_secret_test.go')
-rw-r--r--model/mfa_secret_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/model/mfa_secret_test.go b/model/mfa_secret_test.go
new file mode 100644
index 000000000..c062e7311
--- /dev/null
+++ b/model/mfa_secret_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 TestMfaSecretJson(t *testing.T) {
+ secret := MfaSecret{Secret: NewId(), QRCode: NewId()}
+ json := secret.ToJson()
+ result := MfaSecretFromJson(strings.NewReader(json))
+
+ if secret.Secret != result.Secret {
+ t.Fatal("Secrets do not match")
+ }
+}