mirror of
https://github.com/warmbly/warmbly.git
synced 2026-11-28 16:06:08 +00:00
21 lines
717 B
Go
21 lines
717 B
Go
package notification
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/warmbly/warmbly/internal/models"
|
|
)
|
|
|
|
func TestEmailBodyLeavesAnInboundSubjectOut(t *testing.T) {
|
|
subject := "Claim your prize at evil.example"
|
|
for _, cat := range []models.NotificationCategory{models.NotifInboundReply, models.NotifInboundPositiveReply, models.NotifInboundOOO} {
|
|
if got := emailBody(models.Notification{Category: cat, Body: subject}); strings.Contains(got, subject) {
|
|
t.Errorf("%s: email body carries the sender's subject", cat)
|
|
}
|
|
}
|
|
if got := emailBody(models.Notification{Category: models.NotifCampaignPaused, Body: "Bounce rate above 5%"}); got != "Bounce rate above 5%" {
|
|
t.Errorf("other bodies changed: %q", got)
|
|
}
|
|
}
|