Permalink
Browse files

passing test for sequence messages

  • Loading branch information...
1 parent 08dda46 commit db92b3a38a509be97f8a21d432f03a9ac2980f9d @substack committed Dec 16, 2011
Showing with 5 additions and 4 deletions.
  1. +2 −2 lib/client/proto.js
  2. +3 −2 test/sequence.js
View
@@ -82,11 +82,11 @@ module.exports = function (domain, stream) {
});
}
else if (cmd.name === 'data') {
- if (!req.to) {
+ if (!req.from) {
write(503, 'Bad sequence: MAIL expected');
next();
}
- else if (!req.from) {
+ else if (!req.to) {
write(503, 'Bad sequence: RCPT expected');
next();
}
View
@@ -87,11 +87,12 @@ function sendData (t, mail) {
.seq(function () {
mail.from('beep@localhost', this);
})
- .seq(function (next) {
+ .seq_(function (next) {
mail.data(function (err, code, lines) {
- t.ok(err);
+ t.ok(!err);
t.equal(code, 503);
t.equal(lines.join(''), 'Bad sequence: RCPT expected');
+ next();
})
})
.seq(function () {

0 comments on commit db92b3a

Please sign in to comment.