Extract block to configure remote census in tests

Co-Authored-By: Javi Martín <javim@elretirao.net>
This commit is contained in:
Senén Rodero Rodríguez
2020-09-29 15:53:55 +02:00
committed by Javi Martín
parent b170949fc1
commit 06dcbd699c
11 changed files with 48 additions and 128 deletions

View File

@@ -53,18 +53,7 @@ describe "DocumentVerifications" do
end
end
context "Remote Census API" do
before do
Setting["feature.remote_census"] = true
Setting["remote_census.request.date_of_birth"] = "some.value"
Setting["remote_census.request.postal_code"] = "some.value"
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.valid"] = access_user_data
end
context "Remote Census API", :remote_census do
scenario "Verifying a user which does not exist and is not in the census shows an error" do
expect_any_instance_of(Verification::Management::Document).to receive(:in_census?).
and_return(false)