kendo-backbone
Version:
Bind a Backbone.Collection to a Kendo DataSource
26 lines (19 loc) • 663 B
JavaScript
describe("Kendo UI Backbone DataSource - update", function(){
describe("when updating a model that came from a Backbone.Collection", function(){
var ds, collection, model;
beforeEach(function(){
model = new Backbone.Model({id: 1, foo: "bar"});
collection = new Backbone.Collection([model]);
ds = new kendo.Backbone.DataSource({
collection: collection,
autoSync: true
});
ds.read();
var kModel = ds.get(1);
kModel.set("foo", "updated");
});
it("should push the updates to the Backbone.Collection model", function(){
expect(model.get("foo")).toBe("updated");
});
});
});