You've already forked golang-saas-starter-kit
mirror of
https://github.com/raseels-repos/golang-saas-starter-kit.git
synced 2025-06-27 00:51:13 +02:00
Fix unittests
This commit is contained in:
@ -232,15 +232,16 @@ func TestCreateValidation(t *testing.T) {
|
||||
// of type interface validator.ValidationErrorsTranslations
|
||||
var errStr string
|
||||
if err != nil {
|
||||
errStr = err.Error()
|
||||
errStr = strings.Replace(err.Error(), "{{", "", -1)
|
||||
errStr = strings.Replace(errStr, "}}", "", -1)
|
||||
}
|
||||
var expectStr string
|
||||
if tt.error != nil {
|
||||
expectStr = tt.error.Error()
|
||||
}
|
||||
if errStr != expectStr {
|
||||
t.Logf("\t\tGot : %+v", err)
|
||||
t.Logf("\t\tWant: %+v", tt.error)
|
||||
t.Logf("\t\tGot : %+v", errStr)
|
||||
t.Logf("\t\tWant: %+v", expectStr)
|
||||
t.Fatalf("\t%s\tCreate user account failed.", tests.Failed)
|
||||
}
|
||||
}
|
||||
@ -411,15 +412,16 @@ func TestUpdateValidation(t *testing.T) {
|
||||
// of type interface validator.ValidationErrorsTranslations
|
||||
var errStr string
|
||||
if err != nil {
|
||||
errStr = err.Error()
|
||||
errStr = strings.Replace(err.Error(), "{{", "", -1)
|
||||
errStr = strings.Replace(errStr, "}}", "", -1)
|
||||
}
|
||||
var expectStr string
|
||||
if tt.error != nil {
|
||||
expectStr = tt.error.Error()
|
||||
}
|
||||
if errStr != expectStr {
|
||||
t.Logf("\t\tGot : %+v", err)
|
||||
t.Logf("\t\tWant: %+v", tt.error)
|
||||
t.Logf("\t\tGot : %+v", errStr)
|
||||
t.Logf("\t\tWant: %+v", expectStr)
|
||||
t.Fatalf("\t%s\tUpdate user account failed.", tests.Failed)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user