From 9a87bb3af68216b53ee8f89d6604c715c7b85b2d Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Thu, 27 Apr 2017 10:55:03 -0400 Subject: Creating common token store and moving email invites and verification to it (#6213) --- model/password_recovery_test.go | 53 ----------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 model/password_recovery_test.go (limited to 'model/password_recovery_test.go') 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) - } -} -- cgit v1.2.3-1-g7c22