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:
committed by
Javi Martín
parent
8257a82f2f
commit
ac6260a2ef
8
spec/fixtures/files/remote_census_api/invalid.xml
vendored
Normal file
8
spec/fixtures/files/remote_census_api/invalid.xml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<s:Body>
|
||||
<response>
|
||||
<data>
|
||||
</data>
|
||||
</response>
|
||||
</s:Body>
|
||||
</s:Envelope>
|
||||
15
spec/fixtures/files/remote_census_api/valid.xml
vendored
Normal file
15
spec/fixtures/files/remote_census_api/valid.xml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<s:Body>
|
||||
<response>
|
||||
<data>
|
||||
<date_of_birth>31/12/1980</date_of_birth>
|
||||
<document_number>12345678Z</document_number>
|
||||
<gender>Male</gender>
|
||||
<name>William</name>
|
||||
<surname>Widmore</surname>
|
||||
<postal_code>28013</postal_code>
|
||||
<district_code>01</district_code>
|
||||
</data>
|
||||
</response>
|
||||
</s:Body>
|
||||
</s:Envelope>
|
||||
Reference in New Issue
Block a user