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
@@ -45,6 +45,9 @@ describe CensusCaller do
|
||||
end
|
||||
|
||||
describe "RemoteCensusApi", :remote_census do
|
||||
let(:valid_body) { { response: { data: { document_number: "12345678" }}} }
|
||||
let(:invalid_body) { { response: { data: {}}} }
|
||||
|
||||
it "returns remote census api response when it's available and response is valid" do
|
||||
remote_census_api_response = RemoteCensusApi::Response.new(valid_body)
|
||||
allow_any_instance_of(RemoteCensusApi).to receive(:call).and_return(remote_census_api_response)
|
||||
|
||||
Reference in New Issue
Block a user