BeforeEach(func() { options = postal.Options{ ReplyTo: "awesomeness", Subject: "the & subject", KindDescription: "the & kind description", SourceDescription: "the & source description", Text: "user & supplied email text", HTML: postal.HTML{BodyContent: "user & supplied html"}, KindID: "the & kind", Endorsement: "this & is the endorsement", Role: "OrgRole", } delivery.Options = options delivery.ClientID = "the\"client id" delivery.MessageID = "some>id" delivery.Space.Name = "the<space" delivery.Organization.Name = "the>org" delivery.Scope = "" }) It("html escapes various fields on the message context", func() { context := postal.NewMessageContext(delivery, sender, domain, cloak, templates) context.Escape() Expect(context.From).To(Equal("*****@*****.**")) Expect(context.ReplyTo).To(Equal("awesomeness")) Expect(context.To).To(Equal("*****@*****.**")) Expect(context.Subject).To(Equal("the & subject")) Expect(context.Text).To(Equal("user & supplied email text")) Expect(context.HTML).To(Equal("user & supplied html"))