From 8752f419b5e5288ab31e3144f0b6e63eb0527eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Abdelkader=20Mart=C3=ADnez=20P=C3=A9rez?= Date: Fri, 23 Aug 2019 12:01:51 +0200 Subject: [PATCH] Implementing 204 on delete and removing unnecessary steps --- poc/bin/kapow | 2 +- .../control/delete/list_order.feature | 24 +++++-------------- .../features/control/delete/success.feature | 4 ++-- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/poc/bin/kapow b/poc/bin/kapow index 43083e7..dc104b9 100755 --- a/poc/bin/kapow +++ b/poc/bin/kapow @@ -360,7 +360,7 @@ def delete_route(app): else: app.change_routes(routes) app["user_routes"] = routes - return web.Response(status=200, reason="OK") + return web.Response(status=204, reason="No Content") return _delete_route diff --git a/spec/test/features/control/delete/list_order.feature b/spec/test/features/control/delete/list_order.feature index ee0c97e..6228f37 100644 --- a/spec/test/features/control/delete/list_order.feature +++ b/spec/test/features/control/delete/list_order.feature @@ -18,12 +18,8 @@ Feature: Routes auto-ordering after deleting in a Kapow! server. will be decreased by one. When I delete the first route inserted - Then I get 200 as response code - And I get "OK" as response reason phrase - When I request a routes listing - Then I get 200 as response code - And I get "OK" as response reason phrase - And I get a list with the following elements: + And I request a routes listing + Then I get a list with the following elements: """ [ { @@ -58,12 +54,8 @@ Feature: Routes auto-ordering after deleting in a Kapow! server. maintain their relative order and indexes. When I delete the last route inserted - Then I get 200 as response code - And I get "OK" as response reason phrase - When I request a routes listing - Then I get 200 as response code - And I get "OK" as response reason phrase - And I get a list with the following elements: + And I request a routes listing + Then I get a list with the following elements: """ [ { @@ -99,12 +91,8 @@ Feature: Routes auto-ordering after deleting in a Kapow! server. following routes will be decreased by one. When I delete the second route inserted - Then I get 200 as response code - And I get "OK" as response reason phrase - When I request a routes listing - Then I get 200 as response code - And I get "OK" as response reason phrase - And I get a list with the following elements: + And I request a routes listing + Then I get a list with the following elements: """ [ { diff --git a/spec/test/features/control/delete/success.feature b/spec/test/features/control/delete/success.feature index 5a4a3f2..7afcc21 100644 --- a/spec/test/features/control/delete/success.feature +++ b/spec/test/features/control/delete/success.feature @@ -10,5 +10,5 @@ Feature: Delete routes in Kapow! server. | GET | /listRootDir | /bin/sh -c | ls -la / \| response /body | | GET | /listDir/{dirname} | /bin/sh -c | ls -la /request/params/dirname \| response /body | When I delete the first route - Then I get 200 as response code - And I get "OK" as response reason phrase + Then I get 204 as response code + And I get "No Content" as response reason phrase