mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Prevent xmlprc tests from outputting errors for failure cases
refs: https://github.com/TryGhost/Toolbox/issues/389
This commit is contained in:
parent
007adb6a33
commit
6512fc770d
1 changed files with 7 additions and 4 deletions
|
@ -10,6 +10,7 @@ const logging = require('@tryghost/logging');
|
|||
|
||||
describe('XMLRPC', function () {
|
||||
let eventStub;
|
||||
let loggingStub;
|
||||
|
||||
beforeEach(function () {
|
||||
eventStub = sinon.stub(events, 'on');
|
||||
|
@ -75,6 +76,7 @@ describe('XMLRPC', function () {
|
|||
const ping = xmlrpc.__get__('ping');
|
||||
|
||||
it('with a post should execute two pings', function (done) {
|
||||
loggingStub = sinon.stub(logging, 'error');
|
||||
const ping1 = nock('http://rpc.pingomatic.com').post('/').reply(200);
|
||||
const testPost = _.clone(testUtils.DataGenerator.Content.posts[2]);
|
||||
|
||||
|
@ -123,7 +125,7 @@ describe('XMLRPC', function () {
|
|||
it('captures && logs errors from requests', function (done) {
|
||||
const testPost = _.clone(testUtils.DataGenerator.Content.posts[2]);
|
||||
const ping1 = nock('http://rpc.pingomatic.com').post('/').reply(400);
|
||||
const loggingStub = sinon.stub(logging, 'error');
|
||||
loggingStub = sinon.stub(logging, 'error');
|
||||
|
||||
ping(testPost);
|
||||
|
||||
|
@ -166,7 +168,7 @@ describe('XMLRPC', function () {
|
|||
</params>
|
||||
</methodResponse>`);
|
||||
|
||||
const loggingStub = sinon.stub(logging, 'error');
|
||||
loggingStub = sinon.stub(logging, 'error');
|
||||
|
||||
ping(testPost);
|
||||
|
||||
|
@ -209,7 +211,7 @@ describe('XMLRPC', function () {
|
|||
</params>
|
||||
</methodResponse>`).replace('\n', ''));
|
||||
|
||||
const loggingStub = sinon.stub(logging, 'error');
|
||||
loggingStub = sinon.stub(logging, 'error');
|
||||
|
||||
ping(testPost);
|
||||
|
||||
|
@ -242,7 +244,7 @@ describe('XMLRPC', function () {
|
|||
</params>
|
||||
</methodResponse>`);
|
||||
|
||||
const loggingStub = sinon.stub(logging, 'error');
|
||||
loggingStub = sinon.stub(logging, 'error');
|
||||
|
||||
ping(testPost);
|
||||
|
||||
|
@ -257,6 +259,7 @@ describe('XMLRPC', function () {
|
|||
});
|
||||
|
||||
it('should behave correctly when getting a 429', function (done) {
|
||||
loggingStub = sinon.stub(logging, 'error');
|
||||
const ping1 = nock('http://rpc.pingomatic.com').post('/').reply(429);
|
||||
const testPost = _.clone(testUtils.DataGenerator.Content.posts[2]);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue