mirror of
https://github.com/eleith/emailjs.git
synced 2024-07-05 20:10:37 +00:00
fixes #195. allows empty text message in the body
This commit is contained in:
parent
de85773709
commit
20f72b9682
@ -85,7 +85,7 @@ Client.prototype =
|
||||
if(!(msg instanceof message.Message)
|
||||
&& msg.from
|
||||
&& (msg.to || msg.cc || msg.bcc)
|
||||
&& (msg.text || this._containsInlinedHtml(msg.attachment)))
|
||||
&& (msg.text !== undefined || this._containsInlinedHtml(msg.attachment)))
|
||||
msg = message.create(msg);
|
||||
|
||||
if(msg instanceof message.Message)
|
||||
|
@ -82,6 +82,32 @@ describe("messages", function()
|
||||
}, done);
|
||||
});
|
||||
|
||||
it('null text', function(done) {
|
||||
send({
|
||||
subject: "this is a test TEXT message from emailjs",
|
||||
from: "zelda@gmail.com",
|
||||
to: "gannon@gmail.com",
|
||||
text: null,
|
||||
"message-id": "this is a special id"
|
||||
}, function(mail)
|
||||
{
|
||||
expect(mail.text).to.equal("\n\n");
|
||||
}, done);
|
||||
});
|
||||
|
||||
it('empty text', function(done) {
|
||||
send({
|
||||
subject: "this is a test TEXT message from emailjs",
|
||||
from: "zelda@gmail.com",
|
||||
to: "gannon@gmail.com",
|
||||
text: "",
|
||||
"message-id": "this is a special id"
|
||||
}, function(mail)
|
||||
{
|
||||
expect(mail.text).to.equal("\n\n");
|
||||
}, done);
|
||||
});
|
||||
|
||||
it("simple unicode text message", function(done)
|
||||
{
|
||||
var message =
|
||||
|
Loading…
Reference in New Issue
Block a user