Modifies census_api to parse genre and dob

This commit is contained in:
kikito
2016-04-12 18:18:25 +02:00
parent 0ae97eada8
commit 4f724ef3bf
2 changed files with 12 additions and 4 deletions

View File

@@ -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