Modifies census_api to parse genre and dob
This commit is contained in:
@@ -29,7 +29,7 @@ describe CensusApi do
|
||||
|
||||
describe '#call' do
|
||||
let(:invalid_body) { {get_habita_datos_response: {get_habita_datos_return: {datos_habitante: {}}}} }
|
||||
let(:valid_body){ {get_habita_datos_response: {get_habita_datos_return: {datos_habitante: {item: {fecha_nacimiento_string: "1/1/1980"}}}}} }
|
||||
let(:valid_body){ {get_habita_datos_response: {get_habita_datos_return: {datos_habitante: {item: {fecha_nacimiento_string: "1-1-1980"}}}}} }
|
||||
|
||||
it "returns the response for the first valid variant" do
|
||||
allow(api).to receive(:get_response_body).with(1, "00123456").and_return(invalid_body)
|
||||
@@ -39,7 +39,7 @@ describe CensusApi do
|
||||
response = api.call(1, "123456")
|
||||
|
||||
expect(response).to be_valid
|
||||
expect(response.date_of_birth).to eq('1/1/1980')
|
||||
expect(response.date_of_birth).to eq(Date.new(1980,1,1))
|
||||
end
|
||||
|
||||
it "returns the last failed response" do
|
||||
|
||||
Reference in New Issue
Block a user