Forked from lkobashigawa/gist:4a0c35ce4d729323d598
Last active
August 29, 2015 14:20
-
-
Save durango/6ef86fcd6b96ef7278c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sinon = require('sinon'); | |
it("Should be able to set the validation mode", function(done) { | |
var spy = sinon.spy(AuthorizeCIM.AuthorizeRequest, 'send'); | |
var date = new Date(); | |
var options = { | |
customerType: 'individual', | |
payment: new Authorize.Payment({ | |
creditCard: new Authorize.CreditCard({ | |
cardNumber: '4111111111111111', | |
expirationDate: (date.getFullYear()+1) + '-10' | |
}) | |
}) | |
} | |
AuthorizeCIM.createCustomerPaymentProfile({ | |
customerProfileId: this.customerProfileId, | |
validationMode: 'liveMode', | |
paymentProfile: options | |
}, function(err,resp) { | |
var call = spy.firstCall; | |
expect(call.args[2].validationMode).to.equal('liveMode'); //passes | |
expect(call.thisValue.validationMode).to.equal('liveMode'); //fails | |
done(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment