mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Added email sending check to v0.1 test suite
This commit is contained in:
parent
27523e2ed7
commit
36026ab929
1 changed files with 13 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
var should = require('should'),
|
var should = require('should'),
|
||||||
|
sinon = require('sinon'),
|
||||||
supertest = require('supertest'),
|
supertest = require('supertest'),
|
||||||
testUtils = require('../../../utils/index'),
|
testUtils = require('../../../utils/index'),
|
||||||
localUtils = require('./utils'),
|
localUtils = require('./utils'),
|
||||||
|
@ -9,6 +10,7 @@ var should = require('should'),
|
||||||
config = require('../../../../server/config/index'),
|
config = require('../../../../server/config/index'),
|
||||||
security = require('../../../../server/lib/security/index'),
|
security = require('../../../../server/lib/security/index'),
|
||||||
settingsCache = require('../../../../server/services/settings/cache'),
|
settingsCache = require('../../../../server/services/settings/cache'),
|
||||||
|
mailService = require('../../../../server/services/mail/index'),
|
||||||
ghost = testUtils.startGhost,
|
ghost = testUtils.startGhost,
|
||||||
request;
|
request;
|
||||||
|
|
||||||
|
@ -300,6 +302,14 @@ describe('Authentication API', function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
beforeEach(function () {
|
||||||
|
sinon.stub(mailService.GhostMailer.prototype, 'send').resolves('Mail is disabled');
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(function () {
|
||||||
|
sinon.restore();
|
||||||
|
});
|
||||||
|
|
||||||
it('is setup? no', function () {
|
it('is setup? no', function () {
|
||||||
return request
|
return request
|
||||||
.get(localUtils.API.getApiQuery('authentication/setup'))
|
.get(localUtils.API.getApiQuery('authentication/setup'))
|
||||||
|
@ -337,6 +347,9 @@ describe('Authentication API', function () {
|
||||||
newUser.id.should.equal(testUtils.DataGenerator.Content.users[0].id);
|
newUser.id.should.equal(testUtils.DataGenerator.Content.users[0].id);
|
||||||
newUser.name.should.equal('test user');
|
newUser.name.should.equal('test user');
|
||||||
newUser.email.should.equal('test@example.com');
|
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…
Add table
Reference in a new issue