Skip to content

Commit

Permalink
Merge pull request stripe#27 from janl/node-0.8.x
Browse files Browse the repository at this point in the history
Fix test suite
  • Loading branch information
abh committed Jul 18, 2012
2 parents e4e7020 + bdb71fb commit 0072fa6
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 23 deletions.
1 change: 0 additions & 1 deletion test/charges.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ vows.describe("Charges API").addBatch({
},
'returns a charge' : function(err, response) {
assert.isNull(err);
console.log("response", response);
assert.isDefined(response);
assert.equal(response.object, 'charge');
assert.isDefined(response.id);
Expand Down
5 changes: 1 addition & 4 deletions test/customers.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ vows.describe("Customer API").addBatch({
},
'returns a customer': function(err, response) {
assert.isNull(err);
console.log("response", response);
assert.isDefined(response);
assert.equal(response.object, 'customer');
assert.equal(response.email, "[email protected]");
Expand All @@ -35,7 +34,7 @@ vows.describe("Customer API").addBatch({
topic: function(create_err, customer) {
stripe.customers.update(customer.id, {
description: "test",
card: { number: "4111111111111111",
card: { number: "4242424242424242",
exp_month: 12,
exp_year: 2020,
name: "T. Ester"
Expand All @@ -50,11 +49,9 @@ vows.describe("Customer API").addBatch({
},
'Delete customer' : {
topic: function(create_err, customer) {
console.log("customer for deletion", customer);
stripe.customers.del(customer.id, this.callback);
},
'Customer was deleted': function(err,response) {
console.log("response", response);
assert.isNull(err);
assert.isTrue(response.deleted);
}
Expand Down
10 changes: 1 addition & 9 deletions test/invoices.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ vows.describe("Invoice API").addBatch({
'returns a plan': function(err, response) {
assert.isNull(err);

console.log('response', response);
assert.isDefined(response);
assert.equal(response.object, 'plan');
assert.equal(response.id, 'foobarbaz_plan');
Expand All @@ -40,7 +39,7 @@ vows.describe("Invoice API").addBatch({
stripe.customers.create({
email: "[email protected]",
plan: plan.id,
card: { number: "4111111111111111",
card: { number: "4242424242424242",
exp_month: d.getMonth() + 1,
exp_year: d.getFullYear() + 1,
name: "T. Ester"
Expand All @@ -50,7 +49,6 @@ vows.describe("Invoice API").addBatch({
'returns a customer': function(err, response) {
assert.isNull(err);

console.log("response", response);
assert.isDefined(response);
assert.equal(response.object, 'customer');
assert.equal(response.email, "[email protected]");
Expand All @@ -68,7 +66,6 @@ vows.describe("Invoice API").addBatch({
'created a charge': function(err, response) {
assert.isNull(err);

console.log('response', response);
assert.isDefined(response);
assert.equal(response.object, 'charge');
assert.equal(response.paid, true);
Expand All @@ -80,7 +77,6 @@ vows.describe("Invoice API").addBatch({
'receives a list of invoices': function(err, response) {
assert.isNull(err);

console.log('response', response);
assert.isDefined(response);
assert.isArray(response.data);
assert.strictEqual(response.data.length > 0, true);
Expand All @@ -97,7 +93,6 @@ vows.describe("Invoice API").addBatch({
'received invoice': function(err, response) {
assert.isNull(err);

console.log('response', response);
assert.isDefined(response);
assert.equal(response.object, 'invoice');
assert.strictEqual(response.total > 0, true);
Expand All @@ -109,7 +104,6 @@ vows.describe("Invoice API").addBatch({
'received upcoming invoice': function(err, response) {
assert.isNull(err);

console.log('response', response);
assert.isDefined(response);
assert.equal(response.object, 'invoice');
assert.strictEqual(response.total > 0, true);
Expand All @@ -121,7 +115,6 @@ vows.describe("Invoice API").addBatch({
'customer deleted': function(err, response) {
assert.isNull(err);

console.log('response', response);
assert.isDefined(response);
assert.isTrue(response.deleted);
},
Expand All @@ -132,7 +125,6 @@ vows.describe("Invoice API").addBatch({
'deleted the subscription plan': function(err, response) {
assert.isNull(err);

console.log('response', response);
assert.isDefined(response);
assert.isTrue(response.deleted);
}
Expand Down
6 changes: 0 additions & 6 deletions test/plans.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ vows.describe("Subscription Plans API").addBatch({
},
'returns a plan': function(err, response) {
assert.isNull(err);
console.log('response', response);
assert.isDefined(response);
assert.equal(response.object, 'plan');
assert.equal(response.id, 'foobarbaz_plan');
Expand All @@ -53,7 +52,6 @@ vows.describe("Subscription Plans API").addBatch({
var p = getFirstPlan();

assert.isNull(err);
console.log('response', response);
assert.isDefined(response);
assert.equal(response.id, p.id);
}
Expand All @@ -70,7 +68,6 @@ vows.describe("Subscription Plans API").addBatch({
},
'returns a plan': function(err, response) {
assert.isNull(err);
console.log('response', response);
assert.isDefined(response);
assert.equal(response.object, 'plan');
assert.equal(response.id, 'bazbarfoo_plan');
Expand All @@ -85,7 +82,6 @@ vows.describe("Subscription Plans API").addBatch({
},
'returns a list of plans': function(err, response) {
assert.isNull(err);
console.log('response', response);

assert.isDefined(response);
assert.isNumber(response.count);
Expand All @@ -102,7 +98,6 @@ vows.describe("Subscription Plans API").addBatch({

var p = getFirstPlan(true);

console.log('response', response);
assert.isDefined(response);
assert.isTrue(response.deleted);
assert.equal(response.id, p.id);
Expand All @@ -118,7 +113,6 @@ vows.describe("Subscription Plans API").addBatch({

var p = getFirstPlan(true);

console.log('response', response);
assert.isDefined(response);
assert.isTrue(response.deleted);
assert.equal(response.id, p.id);
Expand Down
5 changes: 2 additions & 3 deletions test/tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ vows.describe("Tokens API").addBatch({
'Create token' : {
topic: function() {
stripe.token.create({
card: { number: "4111111111111111",
card: { number: "4242424242424242",
exp_month: 1,
exp_year: 2021,
name: "J. Ester"
},
amount: 77
}
}, this.callback);
},
'Got card token': function(err, token) {
Expand Down

0 comments on commit 0072fa6

Please sign in to comment.