Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

category should be an array #29

Merged
merged 1 commit into from

2 participants

@partkyle
Owner

No description provided.

@siyegen siyegen merged commit 2ec8484 into sendgrid:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 1, 2012
  1. @partkyle

    category should be an array

    partkyle authored
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 2 deletions.
  1. +5 −1 lib/smtpapi_headers.js
  2. +1 −1  test/lib/smtpapi_header.test.js
View
6 lib/smtpapi_headers.js
@@ -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) {
View
2  test/lib/smtpapi_header.test.js
@@ -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() {
Something went wrong with that request. Please try again.