2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00

Merge pull request #5595 from halfdan/fix/5593

Don't rely on order of updates when editing multiple settings
This commit is contained in:
Hannah Wolfe 2015-07-21 16:59:16 +01:00
commit 5c637dd37a

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);