From f0d53545e05ea2d217e29a6130fb29dda4a09043 Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Fri, 17 Jan 2014 12:39:50 -0400 Subject: [PATCH] Adicion de behat para PROCESS PERMISSIONS --- .../process_permissions.feature | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 features/backend/process_permissions_resources/process_permissions.feature diff --git a/features/backend/process_permissions_resources/process_permissions.feature b/features/backend/process_permissions_resources/process_permissions.feature new file mode 100644 index 000000000..448910dcf --- /dev/null +++ b/features/backend/process_permissions_resources/process_permissions.feature @@ -0,0 +1,90 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: ProcessPermissions Resources + + @1: TEST FOR GET PROCESS PERMISSIONS /---------------------------------------------------------------------- + Scenario: List all the process permissions (result 0 process permissions) + Given that I have a valid access_token + And I request "project/251815090529619a99a2bf4013294414/process-permissions" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the response has 0 record + + + @2: TEST FOR POST PROCESS PERMISSION /---------------------------------------------------------------------- + Scenario: Create a new process permission + Given that I have a valid access_token + And POST this data: + """ + { + "tas_uid": "", + "usr_uid": "00000000000000000000000000000001", + "op_user_relation": "1", + "op_obj_type": "ANY", + "op_task_source" : "", + "op_participate": "0", + "op_action": "BLOCK", + "op_case_status": "DRAFT" + } + """ + And I request "project/251815090529619a99a2bf4013294414/process-permission" + Then the response status code should be 201 + And store "op_uid" in session array + + @3: TEST FOR GET PROCESS PERMISSIONS /---------------------------------------------------------------------- + Scenario: List all the process permissions (result 1 process permission) + Given that I have a valid access_token + And I request "project/251815090529619a99a2bf4013294414/process-permissions" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the response has 1 record + + @4: TEST FOR PUT PROCESS PERMISSION /----------------------------------------------------------------------- + Scenario: Update a process permission + Given that I have a valid access_token + And PUT this data: + """ + { + "tas_uid": "", + "usr_uid": "00000000000000000000000000000001", + "op_user_relation": "1", + "op_obj_type": "ANY", + "op_task_source" : "", + "op_participate": "0", + "op_action": "VIEW", + "op_case_status": "TO_DO" + } + """ + And that I want to update a resource with the key "op_uid" stored in session array + And I request "project/251815090529619a99a2bf4013294414/process-permission" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + @5: TEST FOR GET PROCESS PERMISSION /----------------------------------------------------------------------- + Scenario: Get a process permission (with change in "op_action" and "op_case_status") + Given that I have a valid access_token + And that I want to get a resource with the key "op_uid" stored in session array + And I request "project/251815090529619a99a2bf4013294414/process-permission" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + And that "op_action" is set to "VIEW" + And that "op_case_status" is set to "TO_DO" + + + @6: TEST FOR DELETE PROCESS PERMISSION /----------------------------------------------------------------------- + Scenario: Delete a process permission + Given that I have a valid access_token + And that I want to delete a resource with the key "op_uid" stored in session array + And I request "project/251815090529619a99a2bf4013294414/process-permission" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + @7: TEST FOR GET PROCESS PERMISSIONS /---------------------------------------------------------------------- + Scenario: List all the process permissions (result 0 process permissions) + Given that I have a valid access_token + And I request "project/251815090529619a99a2bf4013294414/process-permissions" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the response has 0 record \ No newline at end of file