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:
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 () {
|
||||
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/'
|
||||
}
|
||||
];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue