0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Fixed test mocks for Url Service test suite

refs 042618fe93

- There's no longer "getValue" method passed around in UrlService, so the were unnecessary and did a wrong thing here :) Yey, less code!
This commit is contained in:
Naz 2021-11-15 20:11:05 +04:00
parent 382d2dbe94
commit 0681953e1f

View file

@ -159,26 +159,14 @@ describe('Unit: services/url/UrlService', function () {
describe('fn: getPermalinkByUrl', function () {
it('found', function () {
const permalinkStub1 = sinon.stub().returns({
getValue: sinon.stub().returns('/:slug/')
});
const permalinkStub2 = sinon.stub().returns({
getValue: sinon.stub().returns('/:primary_tag/')
});
urlService.urlGenerators = [
{
uid: 0,
router: {
getPermalinks: permalinkStub1
}
permalink: '/:slug/'
},
{
uid: 1,
router: {
getPermalinks: permalinkStub2
}
permalink: '/:primary_tag/'
}
];
@ -189,26 +177,14 @@ describe('Unit: services/url/UrlService', function () {
});
it('found', function () {
const permalinkStub1 = sinon.stub().returns({
getValue: sinon.stub().returns('/:slug/')
});
const permalinkStub2 = sinon.stub().returns({
getValue: sinon.stub().returns('/:primary_tag/')
});
urlService.urlGenerators = [
{
uid: 0,
router: {
getPermalinks: permalinkStub1
}
permalink: '/:slug/'
},
{
uid: 1,
router: {
getPermalinks: permalinkStub2
}
permalink: '/:primary_tag/'
}
];