Skip to content

Commit

Permalink
Merge pull request #29 from partkyle/category-array
Browse files Browse the repository at this point in the history
category should be an array
  • Loading branch information
siyegen committed Mar 1, 2012
2 parents 3825387 + 6a00a6e commit 2ec8484
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/smtpapi_headers.js
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion test/lib/smtpapi_header.test.js
Expand Up @@ -46,7 +46,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() {
Expand Down

0 comments on commit 2ec8484

Please sign in to comment.