can-fixture
Advanced tools
Comparing version 3.0.0-pre.9 to 3.0.0-pre.10
{ | ||
"name": "can-fixture", | ||
"version": "3.0.0-pre.9", | ||
"version": "3.0.0-pre.10", | ||
"description": "Intercept AJAX requests and simulate responses.", | ||
@@ -5,0 +5,0 @@ "main": "fixture.js", |
@@ -119,5 +119,3 @@ var QueryLogic = require("can-query-logic"); | ||
this.connection.createData( typeConvert.call(this,req.data) ).then(function(data){ | ||
var responseData = {}; | ||
responseData[idProp] = req.data[idProp]; | ||
res(responseData); | ||
res(data); | ||
}, function(err){ | ||
@@ -124,0 +122,0 @@ res(403, err); |
@@ -77,1 +77,38 @@ var QUnit = require('steal-qunit'); | ||
}); | ||
QUnit.test("createData, destroyData, updateData", function(assert){ | ||
var store = fixture.store([ | ||
{id: 0, name: "foo"} | ||
], new QueryLogic({identity: ["id"]})); | ||
QUnit.stop(); | ||
store.createData({ | ||
data: {name: "bar"} | ||
}, function(instance){ | ||
QUnit.deepEqual(instance, {id: 1, name: "bar"} ); | ||
QUnit.start(); | ||
}); | ||
/* | ||
.then(function(instance){ | ||
var data = store.getList({}); | ||
assert.deepEqual(data, { | ||
count: 2, | ||
data: [ | ||
{id: 0, name: "foo"}, | ||
{id: 1, name: "updated"} | ||
] | ||
}); | ||
return store.destroyInstance(instance); | ||
}) | ||
.then(function(){ | ||
var data = store.getList({}); | ||
assert.deepEqual(data, { | ||
count: 1, | ||
data: [ | ||
{id: 0, name: "foo"} | ||
] | ||
}); | ||
QUnit.start(); | ||
});*/ | ||
}); |
111146
2839