Files
mattermost/model/mfa_secret_test.go
2019-10-03 00:25:36 +03:00

20 lines
450 B
Go

// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package model
import (
"strings"
"testing"
"github.com/stretchr/testify/require"
)
func TestMfaSecretJson(t *testing.T) {
secret := MfaSecret{Secret: NewId(), QRCode: NewId()}
json := secret.ToJson()
result := MfaSecretFromJson(strings.NewReader(json))
require.Equal(t, secret.Secret, result.Secret, "Secrets do not match")
}