Permalink
Browse files

add email status spec

  • Loading branch information...
1 parent d54735f commit 987fafd733ac9ee80dd0ef725471ebd763903223 @garrensmith committed Feb 11, 2011
Showing with 26 additions and 3 deletions.
  1. +26 −0 spec/email_status_spec.js
  2. +0 −3 spec/sendmail_spec.js
View
@@ -0,0 +1,26 @@
+var describe = require('Jody').describe,
+ Madmimi = require('../lib/index.js');
+
+var madmimi = "";
+
+describe("Mail Status").
+ beforeEach(function () {
+ madmimi = new Madmimi("fake@email.com", "fake-api-key");
+ }).
+ it("Should create correct html request", function (atEnd) {
+ var requestOptions;
+
+ madmimi.request = function (options, body) {
+ requestOptions = options;
+ };
+
+ madmimi.mailStatus('1234', function () {});
+
+ atEnd(function () {
+ requestOptions.host.should().beEqual('madmimi.com');
+ requestOptions.port.should().beEqual('443');
+ requestOptions.path.should().beEqual('/mailers/status/1234?username=fake%40email.com&api_key=fake-api-key');
+ requestOptions.method.should().beEqual('GET');
+ })
+
+ });
View
@@ -30,9 +30,6 @@ describe("Send mail").
requestOptions.path.should().beEqual('/mailer');
requestOptions.method.should().beEqual('POST');
requestOptions.headers['content-type'].should().beEqual('application/x-www-form-urlencoded');
-
-
- //httpBody.should().beEqual("testing");
})
}).
it("Should format email parameters", function (atEnd) {

0 comments on commit 987fafd

Please sign in to comment.