Commit 66ca0209 authored by Tristan Cavelier's avatar Tristan Cavelier

job tests upgraded to tests job workspace

parent 4157b03a
...@@ -865,15 +865,16 @@ ...@@ -865,15 +865,16 @@
}); });
test('Job Update', function () { test('Job Update', function () {
expect(4); expect(5);
var clock, jio, o = {}; var clock, jio, o = {};
clock = sinon.useFakeTimers(); clock = sinon.useFakeTimers();
o.workspace = {};
jio = new JIO({ jio = new JIO({
"type": "fake", "type": "fake",
"id": "Job Update" "id": "Job Update"
}, { }, {
"workspace": {} "workspace": o.workspace
}); });
jio.put({"_id": "a"}).always(function (answer) { jio.put({"_id": "a"}).always(function (answer) {
...@@ -905,18 +906,21 @@ ...@@ -905,18 +906,21 @@
o.first_put_command.success(); o.first_put_command.success();
clock.tick(1); clock.tick(1);
deepEqual(o.workspace, {}, 'No job in the queue');
}); });
test('Job Wait', function () { test('Job Wait', function () {
expect(5); expect(6);
var clock, jio, o = {}; var clock, jio, o = {};
clock = sinon.useFakeTimers(); clock = sinon.useFakeTimers();
o.workspace = {};
jio = new JIO({ jio = new JIO({
"type": "fake", "type": "fake",
"id": "Job Wait" "id": "Job Wait"
}, { }, {
"workspace": {} "workspace": o.workspace
}); });
jio.put({"_id": "a"}).always(function (answer) { jio.put({"_id": "a"}).always(function (answer) {
...@@ -951,11 +955,13 @@ ...@@ -951,11 +955,13 @@
fakestorage['Job Wait/put'].success(); fakestorage['Job Wait/put'].success();
clock.tick(1); clock.tick(1);
deepEqual(o.workspace, {}, 'No job in the queue');
}); });
test('Job Deny + Job condition addition', function () { test('Job Deny + Job condition addition', function () {
expect(1); expect(2);
var clock, jio; var clock, jio, workspace = {};
clock = sinon.useFakeTimers(); clock = sinon.useFakeTimers();
jIO.addJobRuleCondition('isGetMethod', function (job) { jIO.addJobRuleCondition('isGetMethod', function (job) {
...@@ -966,7 +972,7 @@ ...@@ -966,7 +972,7 @@
"type": "fake", "type": "fake",
"id": "Job Wait" "id": "Job Wait"
}, { }, {
"workspace": {}, "workspace": workspace,
"job_rules": [{ "job_rules": [{
"code_name": "get rejecter", "code_name": "get rejecter",
"single": true, "single": true,
...@@ -987,6 +993,8 @@ ...@@ -987,6 +993,8 @@
clock.tick(1); clock.tick(1);
deepEqual(workspace, {}, 'No job in the queue');
}); });
})); }));
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