0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Don't rely on order of updates when editing multiple settings

fixes #5593
This commit is contained in:
Fabian Becker 2015-07-21 12:41:56 +02:00
parent 52f576e185
commit cf4660dd46

View file

@ -118,10 +118,15 @@ describe('Settings Model', function () {
editedModel.attributes.value.should.equal(model2.value);
eventSpy.callCount.should.equal(4);
eventSpy.getCall(0).calledWith('settings.edited').should.be.true;
eventSpy.getCall(1).calledWith('settings.description.edited').should.be.true;
eventSpy.getCall(2).calledWith('settings.edited').should.be.true;
eventSpy.getCall(3).calledWith('settings.title.edited').should.be.true;
// We can't rely on the order of updates.
// We can however expect the first and third call to
// to be `settings.edited`.
eventSpy.firstCall.calledWith('settings.edited').should.be.true;
eventSpy.thirdCall.calledWith('settings.edited').should.be.true;
eventSpy.calledWith('settings.description.edited').should.be.true;
eventSpy.calledWith('settings.title.edited').should.be.true;
done();
}).catch(done);