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

@@ -77,6 +77,11 @@ describe "Signature sheets" do
end
context "Create throught all required_fields_to_verify of custom census api", :remote_census do
before do
mock_valid_remote_census_response
mock_invalid_signature_sheet_remote_census_response
end
scenario "Proposal" do
proposal = create(:proposal)
visit new_admin_signature_sheet_path