Permalink
Browse files

category should be an array

  • Loading branch information...
1 parent dd8bf57 commit 6a00a6edd18b570c7cbdfeff5134255e633c7ad7 @partkyle partkyle committed Mar 1, 2012
Showing with 6 additions and 2 deletions.
  1. +5 −1 lib/smtpapi_headers.js
  2. +1 −1 test/lib/smtpapi_header.test.js
View
@@ -38,7 +38,11 @@ SmtpapiHeaders.prototype.addUniqueArgs = function(val) {
}
SmtpapiHeaders.prototype.setCategory = function(val) {
- this.category = val;
+ if (_.isArray(val)) {
+ this.category = val;
+ } else {
+ this.category = [val];
+ }
}
SmtpapiHeaders.prototype.addCategory = function(val) {
@@ -45,7 +45,7 @@ describe('SmtpapiHeader', function() {
it('should allow setting a single category', function() {
header.setCategory(categories[0]);
- expect(header.category).to.equal(categories[0]);
+ expect(header.category).to.eql([categories[0]]);
});
it('should allow adding categories one at a time', function() {

0 comments on commit 6a00a6e

Please sign in to comment.