From 6b4a6f40757272ac6ed95e503e1de643dac26634 Mon Sep 17 00:00:00 2001 From: Fabrice Lecomte Date: Mon, 16 Mar 2020 22:35:23 +0100 Subject: [PATCH] Refactoring Constitution Tests --- .../runConfigurations/Constitution_Tests.xml | 24 ++++++++++++++++++ .../resources/feature/constitution.feature | 25 ++++++++----------- 2 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 .idea/runConfigurations/Constitution_Tests.xml diff --git a/.idea/runConfigurations/Constitution_Tests.xml b/.idea/runConfigurations/Constitution_Tests.xml new file mode 100644 index 0000000..ec27121 --- /dev/null +++ b/.idea/runConfigurations/Constitution_Tests.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/feature/constitution.feature b/src/test/resources/feature/constitution.feature index 110a1f9..242bcde 100644 --- a/src/test/resources/feature/constitution.feature +++ b/src/test/resources/feature/constitution.feature @@ -1,17 +1,21 @@ -Feature: constitution routes +@constitution +Feature: constitution Scenario: The route for get constitutions must response a 200 + Given I have 3 constitution When I send a GET request to "/constitutions" Then the response status code should be 200 Scenario: The route for get one constitution must response a 200 and return constitution - When I send a GET request to "/constitutions/0ca489a6-ef68-8bd5-2355-5793d4b3d66c" + Given I have constitution with ID "0321c8d1-4ce3-4763-b5f4-a92611d280b4" + When I send a GET request to "/constitutions/0321c8d1-4ce3-4763-b5f4-a92611d280b4" Then the response status code should be 200 And the response should contain object: - | id | 0ca489a6-ef68-8bd5-2355-5793d4b3d66c | + | id | 0321c8d1-4ce3-4763-b5f4-a92611d280b4 | Scenario: The route for create constitution must response a 200 and return object - Given I am authenticated as John Doe with id "64b7b379-2298-43ec-b428-ba134930cabd" + Given I have citizen Henri Poincaré + And I am authenticated as Henri Poincaré When I send a POST request to "/constitutions" with body: """ { @@ -20,19 +24,10 @@ Feature: constitution routes "annonymous":true, "titles":[ { - "id":"8156b66f-a9c8-4fd9-8375-a8a1f42ccfd2", "name":"plop", - "rank":0, - "created_by":{ - "id":"64b7b379-2298-43ec-b428-ba134930cabd" - } + "rank":0 } - ], - "created_by":{ - "id":"64b7b379-2298-43ec-b428-ba134930cabd" - }, - "created_at":null, - "version_number":null + ] } """ Then the response status code should be 200