🐛 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:
Kevin Ansfield 2020-09-02 13:07:38 +01:00
parent 7309cc1ddb
commit 936d7a315a
4 changed files with 6 additions and 6 deletions

View File

@ -211,7 +211,7 @@ const Member = ghostBookshelf.Model.extend({
'members_stripe_customers_subscriptions.customer_id'
).onIn(
'members_stripe_customers_subscriptions.status',
['active', 'trialed']
['active', 'trialing']
);
}
);

View File

@ -110,7 +110,7 @@ describe('Members API', function () {
should.exist(jsonResponse.members);
jsonResponse.members.should.have.length(2);
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[0], 'member', 'stripe');
localUtils.API.checkResponse(jsonResponse.meta.pagination, 'pagination');

View File

@ -218,7 +218,7 @@ describe('Member Model', function run() {
}).then(function (queryResult) {
queryResult.length.should.equal(2);
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();
}).catch(done);

View File

@ -324,7 +324,7 @@ DataGenerator.Content = {
},
{
id: ObjectId.generate(),
email: 'trialed@test.com',
email: 'trialing@test.com',
name: 'Ray Stantz'
}
],
@ -355,7 +355,7 @@ DataGenerator.Content = {
member_id: null, // relation added later
customer_id: 'cus_HR3tBmNhx4QsZZ',
name: 'Ray Stantz',
email: 'trialed@test.com'
email: 'trialing@test.com'
}
],
@ -380,7 +380,7 @@ DataGenerator.Content = {
customer_id: 'cus_HR3tBmNhx4QsZZ',
subscription_id: 'sub_HR3tLNgGAHsa7c',
plan_id: '173e16a1fffa7d232b398e4a9b08d266a456ae8f3d23e5f11cc608ced6730bb9',
status: 'trialed',
status: 'trialing',
cancel_at_period_end: true,
current_period_end: '2025-07-09 19:01:20',
start_date: '2020-06-09 19:01:20',