summaryrefslogtreecommitdiffstats
path: root/model/password_recovery_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-04-27 10:55:03 -0400
committerJoram Wilander <jwawilander@gmail.com>2017-04-27 10:55:03 -0400
commit9a87bb3af68216b53ee8f89d6604c715c7b85b2d (patch)
tree8c06aed890f388b228f3aefb8e398309bc73c0b9 /model/password_recovery_test.go
parent0e007e344bf10993529711f14c4168365c3504c3 (diff)
downloadchat-9a87bb3af68216b53ee8f89d6604c715c7b85b2d.tar.gz
chat-9a87bb3af68216b53ee8f89d6604c715c7b85b2d.tar.bz2
chat-9a87bb3af68216b53ee8f89d6604c715c7b85b2d.zip
Creating common token store and moving email invites and verification to it (#6213)
Diffstat (limited to 'model/password_recovery_test.go')
-rw-r--r--model/password_recovery_test.go53
1 files changed, 0 insertions, 53 deletions
diff --git a/model/password_recovery_test.go b/model/password_recovery_test.go
deleted file mode 100644
index d64f430fc..000000000
--- a/model/password_recovery_test.go
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-package model
-
-import (
- "strings"
- "testing"
-)
-
-func TestPasswordRecoveryIsValid(t *testing.T) {
- // Valid example.
- p := PasswordRecovery{
- UserId: NewId(),
- Code: strings.Repeat("a", 128),
- CreateAt: GetMillis(),
- }
-
- if err := p.IsValid(); err != nil {
- t.Fatal(err)
- }
-
- // Various invalid ones.
- p.UserId = "abc"
- if err := p.IsValid(); err == nil {
- t.Fatal("Should have failed validation")
- }
-
- p.UserId = NewId()
- p.Code = "abc"
- if err := p.IsValid(); err == nil {
- t.Fatal("Should have failed validation")
- }
-
- p.Code = strings.Repeat("a", 128)
- p.CreateAt = 0
- if err := p.IsValid(); err == nil {
- t.Fatal("Should have failed validation")
- }
-}
-
-func TestPasswordRecoveryPreSave(t *testing.T) {
- p := PasswordRecovery{
- UserId: NewId(),
- }
-
- // Check it's valid after running PreSave
- p.PreSave()
-
- if err := p.IsValid(); err != nil {
- t.Fatal(err)
- }
-}