[model/backend,#6][s]: BackendMemory now supports saving of Documents.

This commit is contained in:
Rufus Pollock
2012-01-05 01:39:31 +00:00
parent 97f50c5bf5
commit ce076a2eac
2 changed files with 32 additions and 8 deletions

View File

@@ -27,7 +27,7 @@ test('new Dataset', function () {
});
recline.Model.setBackend(backend);
var dataset = backend.getDataset(datasetId);
expect(6);
expect(7);
dataset.fetch().then(function(dataset) {
equal(dataset.get('name'), metadata.name);
equal(dataset.get('headers'), indata.headers);
@@ -37,8 +37,14 @@ test('new Dataset', function () {
});
dataset.getRows().then(function(docList) {
equal(docList.length, Math.min(10, indata.rows.length));
deepEqual(docList.models[0].toJSON(), indata.rows[0]);
});
var doc1 = docList.models[0];
deepEqual(doc1.toJSON(), indata.rows[0]);
var newVal = 10;
doc1.set({x: newVal});
doc1.save().then(function() {
equal(backend._datasetAsData.data.rows[0].x, newVal);
})
});
});
});