From 11cbd4ab56aa307caad45b7591321ca03465c9f3 Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Thu, 6 Feb 2014 16:14:07 -0400 Subject: [PATCH] Correcion y BeHat para REPORT TABLES --- .../main_tests_report_tables.feature | 104 ++++++++++++++++++ .../engine/src/BusinessModel/ReportTable.php | 1 + 2 files changed, 105 insertions(+) create mode 100644 features/backend/report_tables/main_tests_report_tables.feature diff --git a/features/backend/report_tables/main_tests_report_tables.feature b/features/backend/report_tables/main_tests_report_tables.feature new file mode 100644 index 000000000..526d0beec --- /dev/null +++ b/features/backend/report_tables/main_tests_report_tables.feature @@ -0,0 +1,104 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: DataBase Connections + + Scenario: List all the database connections (result 0 database connections) + Given that I have a valid access_token + And I request "project/96189226752f3e5e23c1303036042196/report-tables" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the response has 0 record + + + Scenario: Create a new database connection + Given that I have a valid access_token + And POST this data: + """ + { + "rep_tab_name" : "PMT_TEST", + "rep_tab_dsc" : "descripcion de la tabla", + "rep_tab_connection" : "workflow", + "rep_tab_type" : "NORMAL", + "rep_tab_grid" : "", + "fields" : [ + { + "fld_dyn" : "COMBO_ACEPTACION", + "fld_name" : "ACEPTACION", + "fld_label" : "ACEPTACION", + "fld_type" : "VARCHAR", + "fld_size" : 5 + },{ + "fld_name" : "CAMPO_PROPIO", + "fld_label" : "CAMPO_PROPIO", + "fld_type" : "VARCHAR", + "fld_size" : 200 + } + ] + } + """ + And I request "project/96189226752f3e5e23c1303036042196/report-table" + Then the response status code should be 201 + And store "rep_uid" in session array + + @3: TEST FOR GET DATABASE CONNECTIONS /---------------------------------------------------------------------- + Scenario: List all the database connections (result 1 database connection) + Given that I have a valid access_token + And I request "project/96189226752f3e5e23c1303036042196/report-tables" + 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 DATABASE CONNECTION /----------------------------------------------------------------------- + Scenario: Update a database connection + Given that I have a valid access_token + And PUT this data: + """ + { + "rep_tab_dsc" : "nueva descripcion", + "fields" : [ + { + "fld_dyn" : "CAMPO_TEXTO", + "fld_name" : "TEXTO", + "fld_label" : "TEXTO", + "fld_type" : "VARCHAR", + "fld_size" : 100 + },{ + "fld_name" : "CAMPO_PROPIO", + "fld_label" : "CAMPO_PROPIO", + "fld_type" : "VARCHAR", + "fld_size" : 200 + } + ] + } + """ + And that I want to update a resource with the key "dbs_uid" stored in session array + And I request "project/96189226752f3e5e23c1303036042196/report-table" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + + Scenario: Get a database connection (with change in "dbs_description" and "dbs_database_name") + Given that I have a valid access_token + And that I want to get a resource with the key "dbs_uid" stored in session array + And I request "project/96189226752f3e5e23c1303036042196/report-table" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + And that "rep_tab_dsc" is set to "nueva descripcion" + + + Scenario: Delete a database connection + Given that I have a valid access_token + And that I want to delete a resource with the key "dbs_uid" stored in session array + And I request "project/96189226752f3e5e23c1303036042196/report-table" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + @7: TEST FOR GET DATABASE CONNECTIONS /---------------------------------------------------------------------- + Scenario: List all the database connections (result 0 database connections) + Given that I have a valid access_token + And I request "project/96189226752f3e5e23c1303036042196/report-tables" + 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 diff --git a/workflow/engine/src/BusinessModel/ReportTable.php b/workflow/engine/src/BusinessModel/ReportTable.php index 290e04859..c738d37c5 100644 --- a/workflow/engine/src/BusinessModel/ReportTable.php +++ b/workflow/engine/src/BusinessModel/ReportTable.php @@ -58,6 +58,7 @@ class ReportTable // REPORT TABLE PROPERTIES $table = $additionalTables->load( $rep_uid, true ); $table['DBS_UID'] = $table['DBS_UID'] == null || $table['DBS_UID'] == '' ? 'workflow' : $table['DBS_UID']; + $repData['REP_UID'] = $rep_uid; $repData['REP_TAB_NAME'] = $table['ADD_TAB_NAME']; $repData['REP_TAB_DESCRIPTION'] = $table['ADD_TAB_DESCRIPTION']; $repData['REP_TAB_CLASS_NAME'] = $table['ADD_TAB_CLASS_NAME'];