mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
🐛 Fixed incorrect status used for trial subscription query
refs 96c18edc82
- replaced `trialed` with `trialing` to correctly match the status used in Stripe
This commit is contained in:
parent
7309cc1ddb
commit
936d7a315a
4 changed files with 6 additions and 6 deletions
|
@ -211,7 +211,7 @@ const Member = ghostBookshelf.Model.extend({
|
||||||
'members_stripe_customers_subscriptions.customer_id'
|
'members_stripe_customers_subscriptions.customer_id'
|
||||||
).onIn(
|
).onIn(
|
||||||
'members_stripe_customers_subscriptions.status',
|
'members_stripe_customers_subscriptions.status',
|
||||||
['active', 'trialed']
|
['active', 'trialing']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -110,7 +110,7 @@ describe('Members API', function () {
|
||||||
should.exist(jsonResponse.members);
|
should.exist(jsonResponse.members);
|
||||||
jsonResponse.members.should.have.length(2);
|
jsonResponse.members.should.have.length(2);
|
||||||
jsonResponse.members[0].email.should.equal('paid@test.com');
|
jsonResponse.members[0].email.should.equal('paid@test.com');
|
||||||
jsonResponse.members[1].email.should.equal('trialed@test.com');
|
jsonResponse.members[1].email.should.equal('trialing@test.com');
|
||||||
localUtils.API.checkResponse(jsonResponse, 'members');
|
localUtils.API.checkResponse(jsonResponse, 'members');
|
||||||
localUtils.API.checkResponse(jsonResponse.members[0], 'member', 'stripe');
|
localUtils.API.checkResponse(jsonResponse.members[0], 'member', 'stripe');
|
||||||
localUtils.API.checkResponse(jsonResponse.meta.pagination, 'pagination');
|
localUtils.API.checkResponse(jsonResponse.meta.pagination, 'pagination');
|
||||||
|
|
|
@ -218,7 +218,7 @@ describe('Member Model', function run() {
|
||||||
}).then(function (queryResult) {
|
}).then(function (queryResult) {
|
||||||
queryResult.length.should.equal(2);
|
queryResult.length.should.equal(2);
|
||||||
queryResult.models[0].get('email').should.equal('paid@test.com');
|
queryResult.models[0].get('email').should.equal('paid@test.com');
|
||||||
queryResult.models[1].get('email').should.equal('trialed@test.com');
|
queryResult.models[1].get('email').should.equal('trialing@test.com');
|
||||||
|
|
||||||
done();
|
done();
|
||||||
}).catch(done);
|
}).catch(done);
|
||||||
|
|
|
@ -324,7 +324,7 @@ DataGenerator.Content = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: ObjectId.generate(),
|
id: ObjectId.generate(),
|
||||||
email: 'trialed@test.com',
|
email: 'trialing@test.com',
|
||||||
name: 'Ray Stantz'
|
name: 'Ray Stantz'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -355,7 +355,7 @@ DataGenerator.Content = {
|
||||||
member_id: null, // relation added later
|
member_id: null, // relation added later
|
||||||
customer_id: 'cus_HR3tBmNhx4QsZZ',
|
customer_id: 'cus_HR3tBmNhx4QsZZ',
|
||||||
name: 'Ray Stantz',
|
name: 'Ray Stantz',
|
||||||
email: 'trialed@test.com'
|
email: 'trialing@test.com'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -380,7 +380,7 @@ DataGenerator.Content = {
|
||||||
customer_id: 'cus_HR3tBmNhx4QsZZ',
|
customer_id: 'cus_HR3tBmNhx4QsZZ',
|
||||||
subscription_id: 'sub_HR3tLNgGAHsa7c',
|
subscription_id: 'sub_HR3tLNgGAHsa7c',
|
||||||
plan_id: '173e16a1fffa7d232b398e4a9b08d266a456ae8f3d23e5f11cc608ced6730bb9',
|
plan_id: '173e16a1fffa7d232b398e4a9b08d266a456ae8f3d23e5f11cc608ced6730bb9',
|
||||||
status: 'trialed',
|
status: 'trialing',
|
||||||
cancel_at_period_end: true,
|
cancel_at_period_end: true,
|
||||||
current_period_end: '2025-07-09 19:01:20',
|
current_period_end: '2025-07-09 19:01:20',
|
||||||
start_date: '2020-06-09 19:01:20',
|
start_date: '2020-06-09 19:01:20',
|
||||||
|
|
Loading…
Add table
Reference in a new issue