summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscottmotte <scott@scottmotte.com>2013-09-18 10:03:33 -0700
committerscottmotte <scott@scottmotte.com>2013-09-18 10:03:33 -0700
commit0ffc6ad0df3d198baf8ff845d3e07366b8dede28 (patch)
treee0a5d40713c95c7714f1598a371c08c1e6d176ec
parent072d18364dca7da56bba2f137580274cb30d8011 (diff)
downloadsendgrid-nodejs-0ffc6ad0df3d198baf8ff845d3e07366b8dede28.zip
sendgrid-nodejs-0ffc6ad0df3d198baf8ff845d3e07366b8dede28.tar.gz
sendgrid-nodejs-0ffc6ad0df3d198baf8ff845d3e07366b8dede28.tar.bz2
Adjust integration test to work with correct error coming from error.message
-rw-r--r--test/integration/sendgrid.test.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/integration/sendgrid.test.js b/test/integration/sendgrid.test.js
index da9a40b..98b15f3 100644
--- a/test/integration/sendgrid.test.js
+++ b/test/integration/sendgrid.test.js
@@ -390,7 +390,18 @@ describe('SendGrid #skip', function () {
it('has a blank send payload', function(done) {
sendgrid.send({}, function(err, json) {
- expect(err.message).to.equal("501 Syntax error");
+ expect(err.message).to.equal("Mail from command failed - 501 Syntax error");
+
+ done();
+ });
+ });
+
+ it('has a blank TO', function(done) {
+ payload.subject += "has a blank TO";
+ payload.to = "";
+
+ sendgrid.send(payload, function(err, json) {
+ expect(err.message).to.equal("Can't send mail - no recipients defined");
done();
});