コード例 #1
0
				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 &amp; subject"))
			Expect(context.Text).To(Equal("user &amp; supplied email text"))
			Expect(context.HTML).To(Equal("user & supplied html"))
			Expect(context.TextTemplate).To(Equal("the plainText email < template"))
			Expect(context.HTMLTemplate).To(Equal("the html <h1> email < template</h1>"))
			Expect(context.SubjectTemplate).To(Equal("the subject < template"))