Commit df7020fb authored by Tristan Cavelier's avatar Tristan Cavelier

replicatestorage one test added

parent 34c31ee8
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
module("ReplicateStorage"); module("ReplicateStorage");
test("Substorage management", function () { test("Substorage management", function () {
expect(1); expect(2);
var clock = sinon.useFakeTimers(), jio = jIO.newJio({ var clock = sinon.useFakeTimers(), jio = jIO.newJio({
"type": "replicate", "type": "replicate",
"storage_list": [{ "storage_list": [{
...@@ -31,13 +31,30 @@ ...@@ -31,13 +31,30 @@
}); });
// post without id // post without id
jio.post({}, function (err, response) { jio.post({}, util.spyJioCallback("value", {
deepEqual(err || response, { "id": "document id a",
"id": "document id a", "ok": true
"ok": true }, "2 Storages DONE + FAIL = DONE"));
}, "2 Storages DONE + FAIL = DONE"); clock.tick(1000);
util.closeAndcleanUpJio(jio);
jio = jIO.newJio({
"type": "replicate",
"storage_list": [{
"type": "dummy",
"mode": "always fail",
"key": "1"
}, {
"type": "dummy",
"mode": "always fail",
"key": "2"
}]
}); });
clock.tick(10000);
jio.post({
}, util.spyJioCallback("status", 409, "2 Storages FAIL + FAIL = FAIL"));
clock.tick(1000);
util.closeAndcleanUpJio(jio); util.closeAndcleanUpJio(jio);
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment