Permalink
Browse files

Merge pull request #29 from partkyle/category-array

category should be an array
  • Loading branch information...
2 parents 3825387 + 6a00a6e commit 2ec848449b8b607c22200f57e92aa96140833bea @siyegen siyegen 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) {
@@ -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() {

0 comments on commit 2ec8484

Please sign in to comment.