Body: []mail.Part{ { ContentType: "text/plain", Content: "Banana", }, { ContentType: "text/html", Content: "<header>banana</header>", }, }, } }) It("returns a populated data mail field as a string", func() { parts := strings.Split(msg.Data(), "\n") boundary := msg.Boundary() Expect(parts).To(ConsistOf([]string{ "From: [email protected]", "To: [email protected]", "Subject: Super Urgent! Read Now!", "Content-Type: multipart/alternative; boundary=" + boundary, "Date: " + time.Now().Format(time.RFC822Z), "Mime-Version: 1.0", "", "--" + boundary, "Content-Type: text/plain; charset=UTF-8", "Content-Transfer-Encoding: quoted-printable", "", "Banana", "--" + boundary,