add checks for version conflicts

This commit is contained in:
2016-04-29 17:25:44 -07:00
parent d00d12683b
commit 72389b65b2

View File

@@ -173,6 +173,12 @@ describe('Worker class', function () {
const msg = failSpy.firstCall.args[1];
expect(msg).to.equal(false);
});
it('should swallow version mismatch errors', function () {
mockQueue.client.update.restore();
sinon.stub(mockQueue.client, 'update').returns(Promise.reject({ statusCode: 409 }));
return worker._claimJob(job);
});
});
describe('failing a job', function () {
@@ -208,6 +214,12 @@ describe('Worker class', function () {
expect(doc).to.have.property('output');
expect(doc.output).to.have.property('content', msg);
});
it('should swallow version mismatch errors', function () {
mockQueue.client.update.restore();
sinon.stub(mockQueue.client, 'update').returns(Promise.reject({ statusCode: 409 }));
return worker._failJob(job);
});
});
});