mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36: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:
parent
382d2dbe94
commit
0681953e1f
1 changed files with 4 additions and 28 deletions
|
@ -159,26 +159,14 @@ describe('Unit: services/url/UrlService', function () {
|
||||||
|
|
||||||
describe('fn: getPermalinkByUrl', function () {
|
describe('fn: getPermalinkByUrl', function () {
|
||||||
it('found', 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 = [
|
urlService.urlGenerators = [
|
||||||
{
|
{
|
||||||
uid: 0,
|
uid: 0,
|
||||||
router: {
|
permalink: '/:slug/'
|
||||||
getPermalinks: permalinkStub1
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
uid: 1,
|
uid: 1,
|
||||||
router: {
|
permalink: '/:primary_tag/'
|
||||||
getPermalinks: permalinkStub2
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -189,26 +177,14 @@ describe('Unit: services/url/UrlService', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('found', 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 = [
|
urlService.urlGenerators = [
|
||||||
{
|
{
|
||||||
uid: 0,
|
uid: 0,
|
||||||
router: {
|
permalink: '/:slug/'
|
||||||
getPermalinks: permalinkStub1
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
uid: 1,
|
uid: 1,
|
||||||
router: {
|
permalink: '/:primary_tag/'
|
||||||
getPermalinks: permalinkStub2
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue