mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Added missing notification email when setting up a site
This commit is contained in:
parent
8b651bff9d
commit
7b97c1ada1
2 changed files with 18 additions and 0 deletions
|
@ -32,6 +32,11 @@ module.exports = {
|
|||
})
|
||||
.then((data) => {
|
||||
return auth.setup.doSettings(data, api.settings);
|
||||
})
|
||||
.then((user) => {
|
||||
const notificationUser = user.toJSON({context: {internal: true}});
|
||||
return auth.setup.sendNotification(notificationUser, api.mail)
|
||||
.then(() => user);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const supertest = require('supertest');
|
||||
const testUtils = require('../../../../utils/index');
|
||||
const localUtils = require('./utils');
|
||||
const config = require('../../../../../server/config/index');
|
||||
const mailService = require('../../../../../server/services/mail/index');
|
||||
|
||||
let ghost = testUtils.startGhost;
|
||||
let request;
|
||||
|
@ -10,6 +12,14 @@ let request;
|
|||
describe.only('Authentication API v2', function () {
|
||||
let ghostServer;
|
||||
|
||||
beforeEach(function () {
|
||||
sinon.stub(mailService.GhostMailer.prototype, 'send').resolves('Mail is disabled');
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
sinon.restore();
|
||||
});
|
||||
|
||||
describe('Blog setup', function () {
|
||||
before(function () {
|
||||
return ghost({forceStart: true})
|
||||
|
@ -56,6 +66,9 @@ describe.only('Authentication API v2', function () {
|
|||
newUser.id.should.equal(testUtils.DataGenerator.Content.users[0].id);
|
||||
newUser.name.should.equal('test user');
|
||||
newUser.email.should.equal('test@example.com');
|
||||
|
||||
mailService.GhostMailer.prototype.send.called.should.be.true();
|
||||
mailService.GhostMailer.prototype.send.args[0][0].to.should.equal('test@example.com');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue