|
14 | 14 | then_i_see_the_check_and_confirm_page_for_nasal_spray |
15 | 15 | and_i_get_confirmation_after_recording |
16 | 16 | and_the_vaccination_record_is_synced_to_nhs |
| 17 | + |
| 18 | + when_vaccination_confirmations_are_sent |
| 19 | + then_an_email_is_sent_to_the_parent_confirming_the_vaccination |
| 20 | + and_a_text_is_sent_to_the_parent_confirming_the_vaccination |
17 | 21 | end |
18 | 22 |
|
19 | 23 | scenario "Administered with injection" do |
|
25 | 29 | and_i_record_that_the_patient_has_been_vaccinated_with_injection |
26 | 30 | then_i_see_the_check_and_confirm_page_for_injection |
27 | 31 | and_i_get_confirmation_after_recording |
| 32 | + |
| 33 | + when_vaccination_confirmations_are_sent |
| 34 | + then_an_email_is_sent_to_the_parent_confirming_the_vaccination |
| 35 | + and_a_text_is_sent_to_the_parent_confirming_the_vaccination |
28 | 36 | end |
29 | 37 |
|
30 | 38 | scenario "Switching between nasal and injection" do |
@@ -180,4 +188,22 @@ def and_i_pick_a_batch_for_injection |
180 | 188 | def and_the_vaccination_record_is_synced_to_nhs |
181 | 189 | assert_enqueued_with(job: SyncVaccinationRecordToNHSJob) |
182 | 190 | end |
| 191 | + |
| 192 | + def when_vaccination_confirmations_are_sent |
| 193 | + SendVaccinationConfirmationsJob.perform_now |
| 194 | + end |
| 195 | + |
| 196 | + def then_an_email_is_sent_to_the_parent_confirming_the_vaccination |
| 197 | + expect_email_to( |
| 198 | + @patient.consents.last.parent.email, |
| 199 | + :vaccination_administered_flu |
| 200 | + ) |
| 201 | + end |
| 202 | + |
| 203 | + def and_a_text_is_sent_to_the_parent_confirming_the_vaccination |
| 204 | + expect_sms_to( |
| 205 | + @patient.consents.last.parent.phone, |
| 206 | + :vaccination_administered_flu |
| 207 | + ) |
| 208 | + end |
183 | 209 | end |
0 commit comments