adding a test for the previous commit -- failed save with wait:true

This commit is contained in:
Jeremy Ashkenas
2012-04-23 17:58:10 -04:00
parent 8aee79ae41
commit bf9e4f6335

View File

@@ -620,6 +620,12 @@ $(document).ready(function() {
equal(changed, 1);
});
test("a failed `save` with `wait` doesn't leave attributes behind", function() {
var model = new Backbone.Model;
model.save({x: 1}, {wait: true});
equal(model.get('x'), void 0);
});
test("`save` with `wait` results in correct attributes if success is called during sync", function() {
var changed = 0;
var model = new Backbone.Model({x: 1, y: 2});