Ghost/ghost/admin/tests/helpers/mailgun.js
Simon Backx 18f4748e8b Fixed tests partially for updated member counts
no issue

Also moves some reused test methods to the test helpers folder (wasn't able to move it to the fixtures because too many tests were failing):
- enableNewsletters helper
- enableStripe helper
- enableMailgun helper
2022-04-26 13:10:16 +01:00

14 lines
788 B
JavaScript

export function enableMailgun(server) {
server.db.settings.find({key: 'mailgun_api_key'})
? server.db.settings.update({key: 'mailgun_api_key'}, {value: 'MAILGUN_API_KEY'})
: server.create('setting', {key: 'mailgun_api_key', value: 'MAILGUN_API_KEY', group: 'email'});
server.db.settings.find({key: 'mailgun_domain'})
? server.db.settings.update({key: 'mailgun_domain'}, {value: 'MAILGUN_DOMAIN'})
: server.create('setting', {key: 'mailgun_domain', value: 'MAILGUN_DOMAIN', group: 'email'});
server.db.settings.find({key: 'mailgun_base_url'})
? server.db.settings.update({key: 'mailgun_base_url'}, {value: 'MAILGUN_BASE_URL'})
: server.create('setting', {key: 'mailgun_base_url', value: 'MAILGUN_BASE_URL', group: 'email'});
}