diff --git a/app/controllers/admin/tiposaliado_controller.rb b/app/controllers/admin/tiposaliado_controller.rb new file mode 100644 index 0000000..06375aa --- /dev/null +++ b/app/controllers/admin/tiposaliado_controller.rb @@ -0,0 +1,34 @@ +module Admin + class TiposaliadoController < Msip::Admin::BasicasController + before_action :set_tipoaliado, + only: [:show, :edit, :update, :destroy] + load_and_authorize_resource class: ::Tipoaliado + + def clase + "::Tipoaliado" + end + + def set_tipoaliado + @basica = Tipoaliado.find(params[:id]) + end + + def atributos_index + [ + :id, + :nombre, + :observaciones, + :fechacreacion_localizada, + :habilitado + ] + end + + def genclase + 'M' + end + + def tipoaliado_params + params.require(:tipoaliado).permit(*atributos_form) + end + + end +end diff --git a/app/models/ability.rb b/app/models/ability.rb index c0b54ed..bd04e2b 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -23,6 +23,7 @@ class Ability < Cor1440Gen::Ability BASICAS_PROPIAS = [ ['', 'cargoestado'], ['', 'regionpago'], + ['', 'tipoaliado'], ] def tablasbasicas diff --git a/app/models/tipoaliado.rb b/app/models/tipoaliado.rb new file mode 100644 index 0000000..9b9cf85 --- /dev/null +++ b/app/models/tipoaliado.rb @@ -0,0 +1,3 @@ +class Tipoaliado < ActiveRecord::Base + include Msip::Basica +end diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index acc0a2b..190f9f7 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -23,4 +23,5 @@ inflect.irregular("cargoestado", "cargosestado") inflect.irregular("consaportante", "consaportantes") inflect.irregular("regionpago", "regionespago") + inflect.irregular("tipoaliado", "tiposaliado") end diff --git a/config/locales/es.yml b/config/locales/es.yml index c7d83a8..cd3722c 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -79,6 +79,9 @@ es: entidad_id: Entidad del Estado cargoestado: Cargo con el Estado detallevinculoestado: Detalle de la entidad/cargo con el Estado + "tipoaliado": + Tipoaliado: Tipo de aliado + Tiposaliado: Tipos de aliado "usuario": fechanac: Fecha de nacimiento sexonac: Sexo de nacimiento diff --git a/db/datos-basicas.sql b/db/datos-basicas.sql index 6b053c5..683c2f1 100644 --- a/db/datos-basicas.sql +++ b/db/datos-basicas.sql @@ -4,8 +4,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 14.5 --- Dumped by pg_dump version 14.5 +-- Dumped from database version 16.2 +-- Dumped by pg_dump version 16.2 SET statement_timeout = 0; @@ -58,6 +58,9 @@ INSERT INTO public.cargoestado (id, nombre, observaciones, fechacreacion, fechad INSERT INTO public.cargoestado (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (4, 'Asistente', NULL, '2022-05-18', NULL, '2022-05-18 00:00:00', '2022-05-18 00:00:00'); INSERT INTO public.cargoestado (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (40, 'Técnico(a) Investigador', NULL, '2022-05-18', NULL, '2022-05-18 00:00:00', '2022-05-18 00:00:00'); INSERT INTO public.cargoestado (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (41, 'Técnico(a) Judicial', NULL, '2022-05-18', NULL, '2022-05-18 00:00:00', '2022-05-18 00:00:00'); +INSERT INTO public.cargoestado (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (42, 'Agente de Producción', NULL, '2023-08-27', NULL, '2023-08-27 00:00:00', '2023-08-27 00:00:00'); +INSERT INTO public.cargoestado (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (43, 'Coordinador(a) de Bienestar', NULL, '2023-08-27', NULL, '2023-08-27 00:00:00', '2023-08-27 00:00:00'); +INSERT INTO public.cargoestado (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (44, 'Profesional', NULL, '2023-08-27', NULL, '2023-08-27 00:00:00', '2023-08-27 00:00:00'); INSERT INTO public.cargoestado (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (5, 'Asistente Administrativo', NULL, '2022-05-18', NULL, '2022-05-18 00:00:00', '2022-05-18 00:00:00'); INSERT INTO public.cargoestado (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (6, 'Asistente de Fiscal', NULL, '2022-05-18', NULL, '2022-05-18 00:00:00', '2022-05-18 00:00:00'); INSERT INTO public.cargoestado (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (7, 'Asistente de Investigador Criminalístico', NULL, '2022-05-18', NULL, '2022-05-18 00:00:00', '2022-05-18 00:00:00'); @@ -77,7 +80,105 @@ SELECT pg_catalog.setval('public.cargoestado_id_seq', 100, true); -- SELECT pg_catalog.setval('public.cargoestado_id_seq', 100, true); +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 16.2 +-- Dumped by pg_dump version 16.2 + +SET statement_timeout = 0; + +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +-- +-- Data for Name: regionpago; Type: TABLE DATA; Schema: public; Owner: - +-- + +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (1, 'SIN INFORMACIÓN', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (10, 'CUNDINAMARCA', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (11, 'NARIÑO', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (12, 'EJE CAFETERO', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (15, 'ANTIOQUIA', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (18, 'CAUCA', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (19, 'LA GUAJIRA', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (20, 'HUILA', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (23, 'NORTE DE SANTANDER', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (27, 'PUTUMAYO', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (29, 'SANTANDER', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (3, 'ATLÁNTICO', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (30, 'SUCRE', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (31, 'TOLIMA', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (32, 'VALLE DEL CAUCA', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (33, 'MAGDALENA', NULL, '2023-11-13', NULL, '2023-11-13 00:00:00', '2023-11-13 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (34, 'BOYACA', NULL, '2023-11-13', NULL, '2023-11-13 00:00:00', '2023-11-13 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (35, 'META', NULL, '2023-11-13', NULL, '2023-11-13 00:00:00', '2023-11-13 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (4, 'BOGOTÁ', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (5, 'BOLIVAR', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (6, 'CAQUETA', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (8, 'CESAR', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); +INSERT INTO public.regionpago (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (9, 'CÓRDOBA', NULL, '2020-08-05', NULL, '2020-08-05 00:00:00', '2020-08-05 00:00:00'); + + +-- +-- Name: regionpago_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - +-- + +SELECT pg_catalog.setval('public.regionpago_id_seq', 100, true); + + +-- +-- PostgreSQL database dump complete +-- + +SELECT pg_catalog.setval('public.regionpago_id_seq', 100, true); +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 16.2 +-- Dumped by pg_dump version 16.2 + +SET statement_timeout = 0; + +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +-- +-- Data for Name: tipoaliado; Type: TABLE DATA; Schema: public; Owner: - +-- + +INSERT INTO public.tipoaliado (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (1, 'Sin información', NULL, '2024-04-08', NULL, '2024-04-08 00:00:00', '2024-04-08 00:00:00'); +INSERT INTO public.tipoaliado (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (2, 'Académico', NULL, '2024-04-08', NULL, '2024-04-08 00:00:00', '2024-04-08 00:00:00'); +INSERT INTO public.tipoaliado (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (3, 'ORP', NULL, '2024-04-08', NULL, '2024-04-08 00:00:00', '2024-04-08 00:00:00'); +INSERT INTO public.tipoaliado (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (4, 'Sindical', NULL, '2024-04-08', NULL, '2024-04-08 00:00:00', '2024-04-08 00:00:00'); +INSERT INTO public.tipoaliado (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (5, 'Funcionario institucional', NULL, '2024-04-08', NULL, '2024-04-08 00:00:00', '2024-04-08 00:00:00'); +INSERT INTO public.tipoaliado (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (6, 'Proveedor', NULL, '2024-04-08', NULL, '2024-04-08 00:00:00', '2024-04-08 00:00:00'); +INSERT INTO public.tipoaliado (id, nombre, observaciones, fechacreacion, fechadeshabilitacion, created_at, updated_at) VALUES (7, 'Donante externo', NULL, '2024-04-08', NULL, '2024-04-08 00:00:00', '2024-04-08 00:00:00'); +-- +-- Name: tipoaliado_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - +-- + +SELECT pg_catalog.setval('public.tipoaliado_id_seq', 100, true); + +-- +-- PostgreSQL database dump complete +-- +SELECT pg_catalog.setval('public.tipoaliado_id_seq', 100, true); diff --git a/db/migrate/20240408174920_create_tipoaliado.rb b/db/migrate/20240408174920_create_tipoaliado.rb new file mode 100644 index 0000000..1754430 --- /dev/null +++ b/db/migrate/20240408174920_create_tipoaliado.rb @@ -0,0 +1,49 @@ +class CreateTipoaliado < ActiveRecord::Migration[7.1] + include Msip::SqlHelper + + def up + create_table :tipoaliado do |t| + t.string :nombre, limit: 500, null: false + t.string :observaciones, limit: 5000 + t.date :fechacreacion, null: false + t.date :fechadeshabilitacion + + t.timestamps + end + cambiaCotejacion('tipoaliado', 'nombre', 500, 'es_co_utf_8') + execute <<-SQL + INSERT INTO tipoaliado(id, nombre, + fechacreacion, created_at, updated_at) VALUES ( + 1, 'Sin información', + '2024-04-08', '2024-04-08', '2024-04-08'); + INSERT INTO tipoaliado(id, nombre, + fechacreacion, created_at, updated_at) VALUES ( + 2, 'Académico', + '2024-04-08', '2024-04-08', '2024-04-08'); + INSERT INTO tipoaliado(id, nombre, + fechacreacion, created_at, updated_at) VALUES ( + 3, 'ORP', + '2024-04-08', '2024-04-08', '2024-04-08'); + INSERT INTO tipoaliado(id, nombre, + fechacreacion, created_at, updated_at) VALUES ( + 4, 'Sindical', + '2024-04-08', '2024-04-08', '2024-04-08'); + INSERT INTO tipoaliado(id, nombre, + fechacreacion, created_at, updated_at) VALUES ( + 5, 'Funcionario institucional', + '2024-04-08', '2024-04-08', '2024-04-08'); + INSERT INTO tipoaliado(id, nombre, + fechacreacion, created_at, updated_at) VALUES ( + 6, 'Proveedor', + '2024-04-08', '2024-04-08', '2024-04-08'); + INSERT INTO tipoaliado(id, nombre, + fechacreacion, created_at, updated_at) VALUES ( + 7, 'Donante externo', + '2024-04-08', '2024-04-08', '2024-04-08'); + SELECT setval('tipoaliado_id_seq', 100); + SQL + end + def down + drop_table :tipoaliado + end +end diff --git a/db/structure.sql b/db/structure.sql index e938b36..805784d 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -6890,6 +6890,40 @@ CREATE TABLE public.sivel2_gen_vinculoestado ( ); +-- +-- Name: tipoaliado; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.tipoaliado ( + id bigint NOT NULL, + nombre character varying(500) NOT NULL COLLATE public.es_co_utf_8, + observaciones character varying(5000), + fechacreacion date NOT NULL, + fechadeshabilitacion date, + created_at timestamp(6) without time zone NOT NULL, + updated_at timestamp(6) without time zone NOT NULL +); + + +-- +-- Name: tipoaliado_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.tipoaliado_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: tipoaliado_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.tipoaliado_id_seq OWNED BY public.tipoaliado.id; + + -- -- Name: aliadoasiste id; Type: DEFAULT; Schema: public; Owner: - -- @@ -7646,6 +7680,13 @@ ALTER TABLE ONLY public.sivel2_gen_maternidad ALTER COLUMN id SET DEFAULT nextva ALTER TABLE ONLY public.sivel2_gen_resagresion ALTER COLUMN id SET DEFAULT nextval('public.sivel2_gen_resagresion_id_seq'::regclass); +-- +-- Name: tipoaliado id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.tipoaliado ALTER COLUMN id SET DEFAULT nextval('public.tipoaliado_id_seq'::regclass); + + -- -- Name: sivel2_gen_acto acto_id_key; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -9246,6 +9287,14 @@ ALTER TABLE ONLY public.sivel2_gen_tviolencia ADD CONSTRAINT tipo_violencia_pkey PRIMARY KEY (id); +-- +-- Name: tipoaliado tipoaliado_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.tipoaliado + ADD CONSTRAINT tipoaliado_pkey PRIMARY KEY (id); + + -- -- Name: msip_persona tipoynumdoc_unicos; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -12480,6 +12529,7 @@ ALTER TABLE ONLY public.sivel2_gen_victimacolectiva_vinculoestado SET search_path TO "$user", public; INSERT INTO "schema_migrations" (version) VALUES +('20240408174920'), ('20240319141612'), ('20240312182320'), ('20240305165644'), diff --git a/test/controllers/tiposaliado_controller_test.rb b/test/controllers/tiposaliado_controller_test.rb new file mode 100644 index 0000000..f931c54 --- /dev/null +++ b/test/controllers/tiposaliado_controller_test.rb @@ -0,0 +1,92 @@ +require '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 +# con id 1 en las mismas o en setup + +module Admin + class TiposaliadoControllerTest < ActionDispatch::IntegrationTest + TIPOALIADO_NUEVO = { + nombre: 'X', + observaciones: 'y', + fechacreacion: '2024-04-08', + fechadeshabilitacion: nil, + created_at: '2024-04-08', + updated_at: '2024-04-08', + } + + IDEX = 10 + + include Rails.application.routes.url_helpers + include Devise::Test::IntegrationHelpers + + setup do + if ENV["CONFIG_HOSTS"] != "www.example.com" + raise "CONFIG_HOSTS debe ser www.example.com" + end + if ENV["RUTA_RELATIVA"] != "/" + raise "Por RUTA_RELATIVA debe ser /" + end + + @current_usuario = ::Usuario.find(1) + sign_in @current_usuario + end + + # Cada prueba se ejecuta en una transacción de la base de datos + # que después de la prueba se revierte. Por lo que no + # debe preocuparse por restaurar/borrar lo que modifique/elimine/agregue + # en cada prueba. + + test "debe presentar listado" do + get admin_tiposaliado_path + assert_response :success + assert_template :index + end + + test "debe presentar resumen de existente" do + tipoaliado = ::Tipoaliado.create!( + TIPOALIADO_NUEVO.merge(id: IDEX) + ) + get admin_tipoaliado_url(Tipoaliado.find(IDEX)) + assert_response :success + assert_template :show + end + + test "debe presentar formulario para nueva" do + get new_admin_tipoaliado_path + assert_response :success + assert_template :new + end + + test "debe crear nueva" do + assert_difference('Tipoaliado.count') do + post admin_tiposaliado_path, params: { + tipoaliado: TIPOALIADO_NUEVO + } + end + + assert_redirected_to admin_tipoaliado_path( + assigns(:tipoaliado)) + end + + test "debe actualizar existente" do + tipoaliado = ::Tipoaliado.create!( + TIPOALIADO_NUEVO.merge(id: IDEX) + ) + patch admin_tipoaliado_path(Tipoaliado.find(IDEX)), + params: { tipoaliado: { nombre: 'YY'}} + + assert_redirected_to admin_tipoaliado_path( + assigns(:tipoaliado)) + end + + test "debe eliminar" do + r = Tipoaliado.create!(TIPOALIADO_NUEVO) + assert_difference('Tipoaliado.count', -1) do + delete admin_tipoaliado_url(Tipoaliado.find(r.id)) + end + + assert_redirected_to admin_tiposaliado_path + end + end +end diff --git a/test/models/tipoaliado_test.rb b/test/models/tipoaliado_test.rb new file mode 100644 index 0000000..1f3193a --- /dev/null +++ b/test/models/tipoaliado_test.rb @@ -0,0 +1,31 @@ +require 'test_helper' + +class TipoaliadoTest < ActiveSupport::TestCase + + PRUEBA_TIPOALIADO = { + nombre: "Tipoaliado", + fechacreacion: "2024-04-08", + created_at: "2024-04-08" + } + + test "valido" do + tipoaliado = ::Tipoaliado.create( + PRUEBA_TIPOALIADO) + assert(tipoaliado.valid?) + tipoaliado.destroy + end + + test "no valido" do + tipoaliado = ::Tipoaliado.new( + PRUEBA_TIPOALIADO) + tipoaliado.nombre = '' + assert_not(tipoaliado.valid?) + tipoaliado.destroy + end + + test "existente" do + tipoaliado = ::Tipoaliado.where(id: 1).take + assert_equal(tipoaliado.nombre, "Sin información") + end + +end