jlelse
/
MailyGo
Archived
1
Fork 0

Add test
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Jan-Lukas Else 2020-10-22 20:20:32 +02:00
parent 81a35b118c
commit be9f477458
1 changed files with 7 additions and 1 deletions

View File

@ -8,7 +8,7 @@ import (
func Test_checkBlacklist(t *testing.T) { func Test_checkBlacklist(t *testing.T) {
prepare := func() { prepare := func() {
os.Clearenv() os.Clearenv()
_ = os.Setenv("BLACKLIST", "test1,test2") _ = os.Setenv("BLACKLIST", "test1,test2,spam word")
appConfig, _ = parseConfig() appConfig, _ = parseConfig()
} }
t.Run("Allowed values", func(t *testing.T) { t.Run("Allowed values", func(t *testing.T) {
@ -23,4 +23,10 @@ func Test_checkBlacklist(t *testing.T) {
t.Error() t.Error()
} }
}) })
t.Run("Multi word spam phrase", func(t *testing.T) {
prepare()
if checkBlacklist([]string{"This is a sPaM WORD"}) == false {
t.Error()
}
})
} }