summaryrefslogtreecommitdiffstats
path: root/test/integration/sendgrid.test.js
diff options
context:
space:
mode:
authorscottmotte <scott@scottmotte.com>2013-07-22 19:44:39 +0000
committerscottmotte <scott@scottmotte.com>2013-07-22 20:35:27 +0000
commit43ac2f7ba76754580c96dae840d6d15c225b717f (patch)
tree54862b9b0b75f92b8033638a6b67acce845423b4 /test/integration/sendgrid.test.js
parent21cbabbafce4e9c6ba773bb7ee9e7ae5cdf493da (diff)
downloadsendgrid-nodejs-43ac2f7ba76754580c96dae840d6d15c225b717f.zip
sendgrid-nodejs-43ac2f7ba76754580c96dae840d6d15c225b717f.tar.gz
sendgrid-nodejs-43ac2f7ba76754580c96dae840d6d15c225b717f.tar.bz2
Simplify's filehandler a bit to move away from step.js
Diffstat (limited to 'test/integration/sendgrid.test.js')
-rw-r--r--test/integration/sendgrid.test.js31
1 files changed, 28 insertions, 3 deletions
diff --git a/test/integration/sendgrid.test.js b/test/integration/sendgrid.test.js
index 9a0b919..4432288 100644
--- a/test/integration/sendgrid.test.js
+++ b/test/integration/sendgrid.test.js
@@ -25,7 +25,7 @@ describe('SendGrid #skip', function () {
beforeEach(function() {
payload = Object.create(default_payload);
- payload.subject += "rest ";
+ payload.subject += "web ";
});
it('has a blank send payload', function(done) {
@@ -34,8 +34,6 @@ describe('SendGrid #skip', function () {
done();
});
-
- done();
});
it('has an optional callback', function(done) {
@@ -239,6 +237,33 @@ describe('SendGrid #skip', function () {
});
});
+ it('handles large files', function(done) {
+ payload.subject += "handles large files";
+ payload.files = [
+ {filename: 'rails.zip', url: "https://github.com/rails/rails/archive/master.zip"}
+ ];
+
+ sendgrid.send(payload, function(success, message) {
+ expect(success).to.be.true;
+
+ done();
+ });
+ });
+
+ it('handles multiple files', function(done) {
+ payload.subject += "handles multiple files";
+ payload.files = [
+ {filename: 'rails.zip', url: "https://github.com/rails/rails/archive/master.zip"},
+ {filename: 'icon.jpg', url: 'http://i.imgur.com/2fDh8.jpg'}
+ ];
+
+ sendgrid.send(payload, function(success, message) {
+ expect(success).to.be.true;
+
+ done();
+ });
+ });
+
it('handles the reply_to field', function(done) {
payload.subject += "handles the reply_to field";