mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Prevent error logging in Urls tests from being output
refs: https://github.com/TryGhost/Toolbox/issues/389
This commit is contained in:
parent
6512fc770d
commit
579ecd5b0b
@ -2,10 +2,12 @@ const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const events = require('../../../../../core/server/lib/common/events');
|
||||
const Urls = require('../../../../../core/server/services/url/Urls');
|
||||
const logging = require('@tryghost/logging');
|
||||
|
||||
describe('Unit: services/url/Urls', function () {
|
||||
let urls;
|
||||
let eventsToRemember;
|
||||
let loggingStub;
|
||||
|
||||
beforeEach(function () {
|
||||
urls = new Urls();
|
||||
@ -70,6 +72,7 @@ describe('Unit: services/url/Urls', function () {
|
||||
|
||||
urls.getByResourceId('object-id-x').resource.data.slug.should.eql('a');
|
||||
|
||||
loggingStub = sinon.stub(logging, 'error');
|
||||
// add duplicate
|
||||
urls.add({
|
||||
url: '/test/',
|
||||
@ -81,6 +84,8 @@ describe('Unit: services/url/Urls', function () {
|
||||
},
|
||||
generatorId: 1
|
||||
});
|
||||
loggingStub.calledOnce.should.eql(true);
|
||||
loggingStub.firstCall.firstArg.should.have.property('code').eql('URLSERVICE_RESOURCE_DUPLICATE');
|
||||
|
||||
should.exist(eventsToRemember['url.added']);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user