Use shorter responses and configuration for specs
By simplyfing the responses the configuration for specs can be simpler too. We're also using more generic terms instead of the ones used in Madrid's Census API. Co-Authored-By: Javi Martín <javim@elretirao.net>
This commit is contained in:
committed by
Javi Martín
parent
3ed4bdaff8
commit
dd0f56f85f
@@ -106,35 +106,28 @@ RSpec.configure do |config|
|
||||
end
|
||||
|
||||
config.before(:each, :remote_census) do |example|
|
||||
Setting["remote_census.request.method_name"] = "get_habita_datos"
|
||||
Setting["remote_census.request.document_type"] = "request.tipo_documento"
|
||||
Setting["remote_census.request.document_number"] = "request.documento"
|
||||
Setting["remote_census.request.date_of_birth"] = "request.fecha_nacimiento"
|
||||
Setting["remote_census.request.postal_code"] = "request.codigo_postal"
|
||||
Setting["feature.remote_census"] = true
|
||||
Setting["remote_census.request.method_name"] = "verify_residence"
|
||||
Setting["remote_census.request.structure"] = '{ "request":
|
||||
{
|
||||
"codigo_institucion": 1,
|
||||
"codigo_portal": 1,
|
||||
"codigo_usuario": 1,
|
||||
"documento": "nil",
|
||||
"tipo_documento": "null",
|
||||
"fecha_nacimiento": "null",
|
||||
"codigo_postal": "nil",
|
||||
"codigo_idioma": 102,
|
||||
"nivel": 3
|
||||
"document_type": "null",
|
||||
"document_number": "nil",
|
||||
"date_of_birth": "null",
|
||||
"postal_code": "nil"
|
||||
}
|
||||
}'
|
||||
|
||||
access_user_data = "get_habita_datos_response.get_habita_datos_return.datos_habitante.item"
|
||||
access_residence_data = "get_habita_datos_response.get_habita_datos_return.datos_vivienda.item"
|
||||
Setting["remote_census.response.date_of_birth"] = "#{access_user_data}.fecha_nacimiento_string"
|
||||
Setting["remote_census.response.postal_code"] = "#{access_residence_data}.codigo_postal"
|
||||
Setting["remote_census.response.district"] = "#{access_residence_data}.codigo_distrito"
|
||||
Setting["remote_census.response.gender"] = "#{access_user_data}.descripcion_sexo"
|
||||
Setting["remote_census.response.name"] = "#{access_user_data}.nombre"
|
||||
Setting["remote_census.response.surname"] = "#{access_user_data}.apellido1"
|
||||
Setting["remote_census.response.valid"] = access_user_data
|
||||
Setting["feature.remote_census"] = true
|
||||
Setting["remote_census.request.document_type"] = "request.document_type"
|
||||
Setting["remote_census.request.document_number"] = "request.document_number"
|
||||
Setting["remote_census.request.date_of_birth"] = "request.date_of_birth"
|
||||
Setting["remote_census.request.postal_code"] = "request.postal_code"
|
||||
Setting["remote_census.response.date_of_birth"] = "response.data.date_of_birth"
|
||||
Setting["remote_census.response.postal_code"] = "response.data.postal_code"
|
||||
Setting["remote_census.response.district"] = "response.data.district_code"
|
||||
Setting["remote_census.response.gender"] = "response.data.gender"
|
||||
Setting["remote_census.response.name"] = "response.data.name"
|
||||
Setting["remote_census.response.surname"] = "response.data.surname"
|
||||
Setting["remote_census.response.valid"] = "response.data.document_number"
|
||||
end
|
||||
|
||||
# Allows RSpec to persist some state between runs in order to support
|
||||
|
||||
Reference in New Issue
Block a user