Commit 4f3218ea authored by Tristan Cavelier's avatar Tristan Cavelier

gidstorage tests, with wrong gid status 400 is expected instead of 409.

parent a31b5bc3
...@@ -7992,8 +7992,9 @@ test("Post", function () { ...@@ -7992,8 +7992,9 @@ test("Post", function () {
o.local_jio.stop(); o.local_jio.stop();
o.spy(o, 'status', 409, 'Post document without respecting constraints ' + // XXX check reason
'-> conflicts'); o.spy(o, 'status', 400, 'Post document without respecting constraints ' +
'-> bad request');
o.jio.post({}, o.f); o.jio.post({}, o.f);
o.tick(o); o.tick(o);
...@@ -8043,6 +8044,11 @@ test("Get", function () { ...@@ -8043,6 +8044,11 @@ test("Get", function () {
o.local_jio.stop(); o.local_jio.stop();
o.spy(o, 'status', 400, 'Get document without respecting constraints ' +
'-> bad request');
o.jio.get({"_id": "a"}, o.f);
o.tick(o);
o.spy(o, 'status', 404, 'Get inexistent document'); o.spy(o, 'status', 404, 'Get inexistent document');
o.jio.get({"_id": "{\"identifier\":[\"c\"]}"}, o.f); o.jio.get({"_id": "{\"identifier\":[\"c\"]}"}, o.f);
o.tick(o); o.tick(o);
...@@ -8148,13 +8154,13 @@ test("Put", function () { ...@@ -8148,13 +8154,13 @@ test("Put", function () {
o.local_jio.put({"_id": "green", "identifier": ["ac", "b"]}); o.local_jio.put({"_id": "green", "identifier": ["ac", "b"]});
o.clock.tick(2000); o.clock.tick(2000);
o.spy(o, 'status', 409, 'Put document without respecting constraints ' + o.spy(o, 'status', 400, 'Put document without respecting constraints ' +
'-> conflicts'); '-> bad request');
o.jio.put({"_id": "a", "identifier": "a", "title": "t"}, o.f); o.jio.put({"_id": "a", "identifier": "a", "title": "t"}, o.f);
o.tick(o); o.tick(o);
o.spy(o, 'status', 409, 'Put document without respecting constraints ' + o.spy(o, 'status', 400, 'Put document without respecting constraints ' +
'-> conflicts'); '-> bad request');
o.jio.put({ o.jio.put({
"_id": "{\"identifier\":[\"a\"]}", "_id": "{\"identifier\":[\"a\"]}",
"identifier": "b", "identifier": "b",
...@@ -8223,8 +8229,8 @@ test("Remove", function () { ...@@ -8223,8 +8229,8 @@ test("Remove", function () {
o.local_jio.stop(); o.local_jio.stop();
o.spy(o, 'status', 409, 'Remove document without respecting constraints ' + o.spy(o, 'status', 400, 'Remove document without respecting constraints ' +
'-> conflicts'); '-> bad request');
o.jio.remove({"_id": "a"}, o.f); o.jio.remove({"_id": "a"}, o.f);
o.tick(o); o.tick(o);
...@@ -8271,9 +8277,8 @@ test("putAttachment", function () { ...@@ -8271,9 +8277,8 @@ test("putAttachment", function () {
o.local_jio.put({"_id": "green", "identifier": ["ac", "b"]}); o.local_jio.put({"_id": "green", "identifier": ["ac", "b"]});
o.clock.tick(2000); o.clock.tick(2000);
o.spy(o, 'status', 400, 'put attachment without respecting constraints ' +
o.spy(o, 'status', 409, 'put attachment without respecting constraints ' + '-> bad request');
'-> conflicts');
o.jio.putAttachment({ o.jio.putAttachment({
"_id": "a", "_id": "a",
"_attachment": "body", "_attachment": "body",
......
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