Added stripe_connect_integration default setting

no-issue

This will be used to store the keys and other information after a
sucessful Stripe Connect OAuth flow.
This commit is contained in:
Fabien O'Carroll 2020-05-28 12:40:49 +02:00 committed by Fabien 'egg' O'Carroll
parent eb962d8e5c
commit 95acbbad93
2 changed files with 9 additions and 1 deletions

View File

@ -214,6 +214,9 @@
},
"members_subscription_settings": {
"defaultValue": "{\"fromAddress\":\"noreply\",\"allowSelfSignup\":true,\"paymentProcessors\":[{\"adapter\":\"stripe\",\"config\":{\"secret_token\":\"\",\"public_token\":\"\",\"product\":{\"name\":\"Ghost Subscription\"},\"plans\":[{\"name\":\"Monthly\",\"currency\":\"usd\",\"interval\":\"month\",\"amount\":\"\"},{\"name\":\"Yearly\",\"currency\":\"usd\",\"interval\":\"year\",\"amount\":\"\"}]}}]}"
},
"stripe_connect_integration": {
"defaultValue": "{}"
}
},
"bulk_email": {

View File

@ -4,6 +4,7 @@ const mockDb = require('mock-knex');
const models = require('../../../core/server/models');
const {knex} = require('../../../core/server/data/db');
const {events} = require('../../../core/server/lib/common');
const defaultSettings = require('../../../core/server/data/schema/default-settings');
describe('Unit: models/settings', function () {
before(function () {
@ -113,8 +114,12 @@ describe('Unit: models/settings', function () {
return models.Settings.populateDefaults()
.then(() => {
const numberOfSettings = Object.keys(defaultSettings).reduce((settings, settingGroup) => {
return settings.concat(Object.keys(defaultSettings[settingGroup]));
}, []).length;
// 2 events per item - settings.added and settings.[name].added
eventSpy.callCount.should.equal(92);
eventSpy.callCount.should.equal(numberOfSettings * 2);
const eventsEmitted = eventSpy.args.map(args => args[0]);
const checkEventEmitted = event => should.ok(eventsEmitted.includes(event), `${event} event should be emitted`);