From 23b0997d7663d614aa7b7f4e32cd5312897ff73c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimir=20T=C3=A1mara=20Pati=C3=B1o?= Date: Wed, 10 Apr 2024 11:46:53 -0500 Subject: [PATCH] Actualiza a sivel2 que reubica campo hijos. Closes #271 --- Gemfile.lock | 6 +++--- db/structure.sql | 7 +++++++ .../controllers/msip/homonimos_controller_test.rb | 4 ++++ test/controllers/regionespago_controller_test.rb | 15 +++------------ test/test_helper.rb | 9 +++++++++ yarn.lock | 6 +++--- 6 files changed, 29 insertions(+), 18 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 279d1c8..8099778 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -74,7 +74,7 @@ GIT GIT remote: https://gitlab.com/pasosdeJesus/msip.git - revision: 52add38b9bc1a18311387aa11ef671ae40927b44 + revision: 707b66b873109230cb5b8ac51b85424fa9befe37 branch: v2.2 specs: msip (2.2.0.beta5) @@ -94,7 +94,7 @@ GIT GIT remote: https://gitlab.com/pasosdeJesus/sivel2_gen.git - revision: 027c2472145c114a9d2d869b419f005daeca55e7 + revision: 8a5cae6a65470725cd6021f2dd0491e443a495a4 branch: v2.2 specs: sivel2_gen (2.2.0.beta4) @@ -237,7 +237,7 @@ GEM debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) - devise (4.9.3) + devise (4.9.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) diff --git a/db/structure.sql b/db/structure.sql index 2281bbf..53c91bb 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -9,6 +9,13 @@ SET xmloption = content; SET client_min_messages = warning; SET row_security = off; +-- +-- Name: public; Type: SCHEMA; Schema: -; Owner: - +-- + +-- *not* creating schema, since initdb creates it + + -- -- Name: es_co_utf_8; Type: COLLATION; Schema: public; Owner: - -- diff --git a/test/controllers/msip/homonimos_controller_test.rb b/test/controllers/msip/homonimos_controller_test.rb index ee99685..2b84b35 100644 --- a/test/controllers/msip/homonimos_controller_test.rb +++ b/test/controllers/msip/homonimos_controller_test.rb @@ -184,6 +184,7 @@ def dedup_ruta(ruta) ) assert_predicate persona1, :valid? + persona2 = Msip::Persona.create( id: 2, nombres: "nombre2", @@ -203,10 +204,12 @@ def dedup_ruta(ruta) id: nil }}) end + debugger assert_redirected_to dedup_ruta(homonimo_path( assigns(:homonimo) )) + debugger idr = response.body.gsub(%r{.*homonimos/}, "").gsub(/">.*/, "").to_i homonimo = Msip::Homonimo.all.take @@ -226,6 +229,7 @@ def dedup_ruta(ruta) assert_template :edit sign_in @current_usuario + debugger assert_difference("Homonimo.count", -1) do delete dedup_ruta(homonimo_path(Homonimo.find(idr))) end diff --git a/test/controllers/regionespago_controller_test.rb b/test/controllers/regionespago_controller_test.rb index dfe50a7..4d1b56f 100644 --- a/test/controllers/regionespago_controller_test.rb +++ b/test/controllers/regionespago_controller_test.rb @@ -1,4 +1,4 @@ -require 'test_helper' +require_relative '../test_helper' # Esta prueba supone que en la tabla básica hay un registro con id 1 # Si no lo hay agregar skip a pruebas que lo suponen o crear registro @@ -6,15 +6,6 @@ module Admin class RegionespagoControllerTest < ActionDispatch::IntegrationTest - REGIONPAGO_NUEVA = { - nombre: 'X', - observaciones: 'y', - fechacreacion: '2023-08-27', - fechadeshabilitacion: nil, - created_at: '2023-08-27', - updated_at: '2023-08-27', - } - IDEX = 10 include Rails.application.routes.url_helpers @@ -51,7 +42,7 @@ class RegionespagoControllerTest < ActionDispatch::IntegrationTest test "debe crear nueva" do assert_difference('Regionpago.count') do post admin_regionespago_path, params: { - regionpago: REGIONPAGO_NUEVA + regionpago: PRUEBA_REGIONPAGO } end @@ -68,7 +59,7 @@ class RegionespagoControllerTest < ActionDispatch::IntegrationTest end test "debe eliminar" do - r = Regionpago.create!(REGIONPAGO_NUEVO) + r = Regionpago.create!(PRUEBA_REGIONPAGO) assert_difference('Regionpago.count', -1) do delete admin_regionpago_url(Regionpago.find(r.id)) end diff --git a/test/test_helper.rb b/test/test_helper.rb index b174836..e4e4615 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -116,6 +116,15 @@ def load_seeds tdocumento_id: 11 } +PRUEBA_REGIONPAGO = { + nombre: 'X', + observaciones: 'y', + fechacreacion: '2023-08-27', + fechadeshabilitacion: nil, + created_at: '2023-08-27', + updated_at: '2023-08-27', +} + PRUEBA_TIPOORG = { nombre: "Tipoorg", fechacreacion: "2021-10-10", diff --git a/yarn.lock b/yarn.lock index 2abafea..1ae9364 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1239,9 +1239,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001587: - version "1.0.30001607" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001607.tgz#b91e8e033f6bca4e13d3d45388d87fa88931d9a5" - integrity sha512-WcvhVRjXLKFB/kmOFVwELtMxyhq3iM/MvmXcyCe2PNf166c39mptscOc/45TTS96n2gpNV2z7+NakArTWZCQ3w== + version "1.0.30001608" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001608.tgz#7ae6e92ffb300e4b4ec2f795e0abab456ec06cc0" + integrity sha512-cjUJTQkk9fQlJR2s4HMuPMvTiRggl0rAVMtthQuyOlDWuqHXqN8azLq+pi8B2TjwKJ32diHjUqRIKeFX4z1FoA== chalk@^2.4.2: version "2.4.2"