Mock remote census responses in tests using XML

By using real XML responses developers will be able to understand better
how the integration works (the data flow), and the correspondency between
`remote_census` settings and their place at a real XML response.

As `stubbed_responses` methods were removed from the model layer now the
stubbing part should be managed from the test environment code so also
added a new helper module `RemoteCensusSetup` that can be used anywhere
where we need to call the web service.

Co-Authored-By: Javi Martín <javim@elretirao.net>
This commit is contained in:
Senén Rodero Rodríguez
2020-10-30 11:16:48 +01:00
committed by Javi Martín
parent 8257a82f2f
commit ac6260a2ef
14 changed files with 185 additions and 209 deletions

View File

@@ -67,7 +67,10 @@ describe "DocumentVerifications" do
expect(page).to have_content "This document is not registered"
end
scenario "Verifying a user which does exists in the census but not in the db redirects allows sending an email" do
scenario "Verifying a user which does exists in the census but not in the db
redirects allows sending an email" do
mock_valid_remote_census_response
visit management_document_verifications_path
fill_in "document_verification_document_number", with: "12345678Z"
select_date "31-December-1980", from: "document_verification_date_of_birth"