|
9 | 9 | end
|
10 | 10 |
|
11 | 11 | scenario "Download spreadsheet, record offline at a school session, upload vaccination outcomes back into Mavis" do
|
| 12 | + stub_pds_get_nhs_number_to_return_a_patient |
| 13 | + |
12 | 14 | given_an_hpv_programme_is_underway
|
13 | 15 | when_i_choose_to_record_offline_from_a_school_session_page
|
14 | 16 | then_i_see_an_excel_spreadsheet_for_recording_offline
|
|
17 | 19 | and_i_upload_the_modified_csv_file
|
18 | 20 | and_i_navigate_to_the_session_page
|
19 | 21 | then_i_see_the_uploaded_vaccination_outcomes_reflected_in_the_session
|
| 22 | + |
| 23 | + when_vaccination_confirmations_are_sent |
| 24 | + then_an_email_is_sent_to_the_parent_confirming_the_vaccination |
| 25 | + and_a_text_is_sent_to_the_parent_confirming_the_vaccination |
20 | 26 | end
|
21 | 27 |
|
22 | 28 | scenario "Download spreadsheet, record offline at a clinic, upload vaccination outcomes back into Mavis" do
|
| 29 | + stub_pds_get_nhs_number_to_return_a_patient |
| 30 | + |
23 | 31 | given_an_hpv_programme_is_underway(clinic: true)
|
24 | 32 | when_i_choose_to_record_offline_from_a_clinic_page
|
25 | 33 | then_i_see_an_excel_spreadsheet_for_recording_offline
|
|
29 | 37 | and_i_navigate_to_the_clinic_page
|
30 | 38 | then_i_see_the_uploaded_vaccination_outcomes_reflected_in_the_session
|
31 | 39 | and_the_clinic_location_is_displayed
|
| 40 | + |
| 41 | + when_vaccination_confirmations_are_sent |
| 42 | + then_an_email_is_sent_to_the_parent_confirming_the_vaccination |
| 43 | + and_a_text_is_sent_to_the_parent_confirming_the_vaccination |
32 | 44 | end
|
33 | 45 |
|
34 | 46 | def given_an_hpv_programme_is_underway(clinic: false)
|
@@ -267,4 +279,36 @@ def then_i_see_the_uploaded_vaccination_outcomes_reflected_in_the_session
|
267 | 279 | def and_the_clinic_location_is_displayed
|
268 | 280 | expect(page).to have_content("Westfield Shopping Centre")
|
269 | 281 | end
|
| 282 | + |
| 283 | + def when_vaccination_confirmations_are_sent |
| 284 | + VaccinationConfirmationsJob.perform_now |
| 285 | + end |
| 286 | + |
| 287 | + def then_an_email_is_sent_to_the_parent_confirming_the_vaccination |
| 288 | + expect_email_to( |
| 289 | + @vaccinated_patient.consents.last.parent.email, |
| 290 | + :vaccination_confirmation_administered, |
| 291 | + :any |
| 292 | + ) |
| 293 | + |
| 294 | + expect_email_to( |
| 295 | + @unvaccinated_patient.consents.last.parent.email, |
| 296 | + :vaccination_confirmation_not_administered, |
| 297 | + :any |
| 298 | + ) |
| 299 | + end |
| 300 | + |
| 301 | + def and_a_text_is_sent_to_the_parent_confirming_the_vaccination |
| 302 | + expect_text_to( |
| 303 | + @vaccinated_patient.consents.last.parent.phone, |
| 304 | + :vaccination_confirmation_administered, |
| 305 | + :any |
| 306 | + ) |
| 307 | + |
| 308 | + expect_text_to( |
| 309 | + @unvaccinated_patient.consents.last.parent.phone, |
| 310 | + :vaccination_confirmation_not_administered, |
| 311 | + :any |
| 312 | + ) |
| 313 | + end |
270 | 314 | end
|
0 commit comments