mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
testify model/user_terms_of_Service test (#12639)
This commit is contained in:
committed by
Jesús Espino
parent
b56ce0e67a
commit
f7a8d63cd0
@@ -8,29 +8,21 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestUserTermsOfServiceIsValid(t *testing.T) {
|
||||
s := UserTermsOfService{}
|
||||
|
||||
if err := s.IsValid(); err == nil {
|
||||
t.Fatal("should be invalid")
|
||||
}
|
||||
require.Error(t, s.IsValid(), "should be invalid")
|
||||
|
||||
s.UserId = NewId()
|
||||
if err := s.IsValid(); err == nil {
|
||||
t.Fatal("should be invalid")
|
||||
}
|
||||
require.Error(t, s.IsValid(), "should be invalid")
|
||||
|
||||
s.TermsOfServiceId = NewId()
|
||||
if err := s.IsValid(); err == nil {
|
||||
t.Fatal("should be invalid")
|
||||
}
|
||||
require.Error(t, s.IsValid(), "should be invalid")
|
||||
|
||||
s.CreateAt = GetMillis()
|
||||
if err := s.IsValid(); err != nil {
|
||||
t.Fatal("should be valid")
|
||||
}
|
||||
require.Nil(t, s.IsValid(), "should be valid")
|
||||
}
|
||||
|
||||
func TestUserTermsOfServiceJson(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user