Adds specs for creating failed officing census calls

This commit is contained in:
kikito
2017-02-08 14:55:44 +01:00
parent 871846c070
commit 8ca4cc22b0
3 changed files with 26 additions and 4 deletions

View File

@@ -52,10 +52,11 @@ feature 'Residence' do
end
click_button 'Validate document'
expect(page).to have_content /\d errors? prevented the verification of this document/
expect(page).to have_content(/\d errors? prevented the verification of this document/)
end
scenario "Error on Census (document number)" do
initial_failed_census_calls_count = officer.failed_census_calls_count
within("#side_menu") do
click_link "Validate document"
end
@@ -67,6 +68,13 @@ feature 'Residence' do
click_button 'Validate document'
expect(page).to have_content 'The Census was unable to verify this document'
officer.reload
fcc = FailedCensusCall.last
expect(fcc).to be
expect(fcc.poll_officer).to eq(officer)
expect(officer.failed_census_calls.last).to eq(fcc)
expect(officer.failed_census_calls_count).to eq(initial_failed_census_calls_count + 1)
end
scenario "Error on Census (year of birth)" do
@@ -85,4 +93,4 @@ feature 'Residence' do
end
end
end