55
66 scenario "Administered with nasal spray" do
77 given_i_am_signed_in_with_flu_programme
8- and_there_is_a_flu_session_today_with_two_patients_ready_to_vaccinate
8+ and_there_is_a_flu_session_today_with_patients_ready_to_vaccinate
99 and_there_are_nasal_and_injection_batches
1010 and_sync_vaccination_records_to_nhs_on_create_feature_is_enabled
1111
2424
2525 scenario "Administered with injection" do
2626 given_i_am_signed_in_with_flu_programme
27- and_there_is_a_flu_session_today_with_two_patients_ready_to_vaccinate
27+ and_there_is_a_flu_session_today_with_patients_ready_to_vaccinate
2828 and_there_are_nasal_and_injection_batches
2929
3030 when_i_go_to_the_injection_only_patient
3939 and_a_text_is_sent_to_the_parent_confirming_the_vaccination
4040 end
4141
42+ scenario "Administered with injection instead of nasal" do
43+ given_i_am_signed_in_with_flu_programme
44+ and_there_is_a_flu_session_today_with_patients_ready_to_vaccinate
45+ and_there_are_nasal_and_injection_batches
46+
47+ when_i_go_to_the_nasal_or_injection_patient
48+ then_i_see_the_vaccination_form_for_nasal_spray
49+ and_i_see_the_option_to_administer_injection
50+
51+ when_i_record_that_the_patient_has_been_vaccinated_with_injection_instead
52+ then_i_see_the_check_and_confirm_page_for_injection
53+ and_i_get_confirmation_after_recording
54+
55+ when_vaccination_confirmations_are_sent
56+ then_an_email_is_sent_to_the_parent_confirming_the_vaccination
57+ and_a_text_is_sent_to_the_parent_confirming_the_vaccination
58+ end
59+
4260 scenario "Switching between nasal and injection" do
4361 given_i_am_signed_in_with_flu_programme
44- and_there_is_a_flu_session_today_with_two_patients_ready_to_vaccinate
62+ and_there_is_a_flu_session_today_with_patients_ready_to_vaccinate
4563 and_there_are_nasal_and_injection_batches
4664
4765 when_i_go_to_the_nasal_only_patient
@@ -71,14 +89,21 @@ def given_i_am_signed_in_with_flu_programme
7189 sign_in @organisation . users . first
7290 end
7391
74- def and_there_is_a_flu_session_today_with_two_patients_ready_to_vaccinate
75- @nasal_patient =
92+ def and_there_is_a_flu_session_today_with_patients_ready_to_vaccinate
93+ @nasal_only_patient =
7694 create (
7795 :patient ,
7896 :consent_given_nasal_only_triage_not_needed ,
7997 :in_attendance ,
8098 session : @session
8199 )
100+ @nasal_or_injection_patient =
101+ create (
102+ :patient ,
103+ :consent_given_nasal_or_injection_triage_not_needed ,
104+ :in_attendance ,
105+ session : @session
106+ )
82107 @injection_patient =
83108 create (
84109 :patient ,
@@ -120,7 +145,13 @@ def and_sync_vaccination_records_to_nhs_on_create_feature_is_enabled
120145
121146 def when_i_go_to_the_nasal_only_patient
122147 visit session_record_path ( @session )
123- @patient = @nasal_patient
148+ @patient = @nasal_only_patient
149+ click_link @patient . full_name
150+ end
151+
152+ def when_i_go_to_the_nasal_or_injection_patient
153+ visit session_record_path ( @session )
154+ @patient = @nasal_or_injection_patient
124155 click_link @patient . full_name
125156 end
126157
@@ -144,6 +175,12 @@ def then_i_see_the_vaccination_form_for_injection
144175 )
145176 end
146177
178+ def and_i_see_the_option_to_administer_injection
179+ expect ( page ) . to have_content (
180+ "No — but they can have the injected flu instead"
181+ )
182+ end
183+
147184 def when_i_record_that_the_patient_has_been_vaccinated_with_nasal_spray
148185 within all ( "section" ) [ 0 ] do
149186 check "I have checked that the above statements are true"
@@ -175,6 +212,21 @@ def when_i_record_that_the_patient_has_been_vaccinated_with_injection
175212 click_button "Continue"
176213 end
177214
215+ def when_i_record_that_the_patient_has_been_vaccinated_with_injection_instead
216+ within all ( "section" ) [ 0 ] do
217+ check "I have checked that the above statements are true"
218+ end
219+
220+ within all ( "section" ) [ 1 ] do
221+ choose "No — but they can have the injected flu instead"
222+ choose "Left arm (upper position)"
223+ click_button "Continue"
224+ end
225+
226+ choose @injection_batch . name
227+ click_button "Continue"
228+ end
229+
178230 def then_i_see_the_check_and_confirm_page_for_nasal_spray
179231 expect ( page ) . to have_content ( "Check and confirm" )
180232 expect ( page ) . to have_content ( @patient . full_name )
0 commit comments