mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
c539d39875
closes #10020 * Append trailing slash to version path
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
var should = require('should'),
|
|
sinon = require('sinon'),
|
|
proxyquire = require('proxyquire'),
|
|
sandbox = sinon.sandbox.create();
|
|
|
|
describe('parent app', function () {
|
|
let expressStub;
|
|
let use;
|
|
let apiSpy;
|
|
let parentApp;
|
|
let adminSpy;
|
|
let siteSpy;
|
|
|
|
beforeEach(function () {
|
|
use = sandbox.spy();
|
|
expressStub = () => ({
|
|
use,
|
|
enable: () => {}
|
|
});
|
|
|
|
apiSpy = sinon.spy();
|
|
adminSpy = sinon.spy();
|
|
siteSpy = sinon.spy();
|
|
|
|
parentApp = proxyquire('../../../server/web/parent-app', {
|
|
express: expressStub,
|
|
'./api': apiSpy,
|
|
'./admin': adminSpy,
|
|
'./site': siteSpy
|
|
});
|
|
});
|
|
|
|
afterEach(function () {
|
|
sandbox.restore();
|
|
});
|
|
|
|
it('should mount 3 apps and assign correct routes to them', function () {
|
|
parentApp();
|
|
|
|
use.calledWith('/ghost/api').should.be.true();
|
|
use.calledWith('/ghost').should.be.true();
|
|
|
|
apiSpy.called.should.be.true();
|
|
adminSpy.called.should.be.true();
|
|
siteSpy.called.should.be.true();
|
|
});
|
|
});
|