From 56fedde61266ac0ad89bb5126ed21356b931f679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Fri, 8 Sep 2017 13:39:49 +0200 Subject: [PATCH] update status code (202 -> 200) --- server.js | 4 ++-- test/specs.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server.js b/server.js index 55fca4f..405d629 100644 --- a/server.js +++ b/server.js @@ -130,7 +130,7 @@ router.delete("/:object/:id",function(req,res){ var thing = config[resource].state.storage[id]; delete config[resource].state.storage[id] - success(res, 202, thing); + success(res, 200, thing); }); // Update a thing @@ -155,7 +155,7 @@ router.put("/:object/:id",function(req,res){ } config[resource].state.storage[id] = thing; - success(res, 202, thing); + success(res, 200, thing); }); // diff --git a/test/specs.js b/test/specs.js index 93ea725..326a352 100644 --- a/test/specs.js +++ b/test/specs.js @@ -98,7 +98,7 @@ describe('server.js tests', function () { .set('Content-Type', "application/json") .send({ name: "Dog", price: 9, id: id }) .expect('Content-Type', /^application[/]json/) - .expect(202) + .expect(200) .expect((res) => { assert.equal(res.body.name, "Dog", "item.name == dog"); assert.equal(res.body.price, 9, "item.price == 9"); @@ -125,7 +125,7 @@ describe('server.js tests', function () { request(server) .delete('/things/' + encodeURIComponent(id) + '/') .expect('Content-Type', /^application[/]json/) - .expect(202) + .expect(200) .expect((res) => { assert.equal(res.body.name, "Dog", "item.name == dog"); assert.equal(res.body.price, 9, "item.price == 9");