email/email_test.go
2022-10-17 16:43:55 +08:00

19 lines
327 B
Go

package email
import (
"strings"
"testing"
)
func TestAttachment(t *testing.T) {
m := NewMessage("Hi", "this is the body")
if err := m.AttachBuffer("test.ics", []byte("test"), false); err != nil {
t.Fatal(err)
}
if strings.Contains(string(m.Bytes()), "text/calendar") == false {
t.Fatal("Issue with mailer")
}
}