onSaveEvent: function (event) {
if (this.model !== null) {
var that = this;
this.model.save(this.model.toJSON(), {
success: function (model) {
that.model = model;
that.model.attributes.isDirty = false;
},
error: function (model, xhr) {
that.model.attributes.isDirty = true;
}
});
}
}
}
如何在 Jasmine 中对模型的保存成功和错误响应进行单元测试?