65
65
and_i_am_signed_in ( role : :healthcare_assistant )
66
66
67
67
when_i_visit_the_session_patient_programme_page
68
- and_i_record_that_the_patient_has_been_vaccinated_with_nasal_spray
68
+ then_i_am_able_to_vaccinate_them_with_nasal_via_psd
69
69
and_the_vaccination_record_has_psd_as_the_protocol
70
70
end
71
71
72
+ scenario "PSD and national protocol enabled, no PSD, but patient consented nasal spray" do
73
+ given_a_flu_session_exists (
74
+ user_type : :with_one_healthcare_assistant ,
75
+ national_protocol_enabled : true
76
+ )
77
+ and_patients_exist
78
+ and_i_am_signed_in ( role : :healthcare_assistant )
79
+
80
+ when_i_visit_the_session_patient_programme_page
81
+ then_i_am_able_to_vaccinate_them_via_pgd
82
+ and_the_vaccination_record_has_pdg_as_the_protocol
83
+ end
84
+
72
85
def given_delegation_feature_flag_is_enabled
73
86
Flipper . enable ( :delegation )
74
87
end
75
88
76
- def given_a_flu_session_exists ( user_type :)
89
+ def given_a_flu_session_exists ( user_type :, national_protocol_enabled : false )
77
90
@programme = create ( :programme , :flu )
78
91
@programmes = [ @programme ]
79
92
@team = create ( :team , user_type , programmes : @programmes )
93
+ @nurse = create ( :nurse , team : @team )
80
94
81
95
@batch =
82
96
create (
@@ -93,7 +107,8 @@ def given_a_flu_session_exists(user_type:)
93
107
:requires_no_registration ,
94
108
:psd_enabled ,
95
109
team : @team ,
96
- programmes : @programmes
110
+ programmes : @programmes ,
111
+ national_protocol_enabled :
97
112
)
98
113
end
99
114
@@ -197,7 +212,7 @@ def then_i_should_not_see_the_record_vaccination_section
197
212
expect ( page ) . not_to have_text ( "Record flu vaccination with injection" )
198
213
end
199
214
200
- def and_i_record_that_the_patient_has_been_vaccinated_with_nasal_spray
215
+ def then_i_am_able_to_vaccinate_them_with_nasal_via_psd
201
216
within all ( "section" ) [ 0 ] do
202
217
check "I have checked that the above statements are true"
203
218
end
@@ -214,7 +229,27 @@ def and_i_record_that_the_patient_has_been_vaccinated_with_nasal_spray
214
229
expect ( page ) . to have_text ( "Vaccination outcome recorded for flu" )
215
230
end
216
231
232
+ def then_i_am_able_to_vaccinate_them_via_pgd
233
+ check "I have checked that the above statements are true"
234
+
235
+ select @nurse . full_name
236
+ within all ( "section" ) [ 1 ] do
237
+ choose "Yes"
238
+ end
239
+ click_on "Continue"
240
+
241
+ choose @batch . name
242
+ click_on "Continue"
243
+
244
+ click_on "Confirm"
245
+ click_on "Record vaccinations"
246
+ end
247
+
217
248
def and_the_vaccination_record_has_psd_as_the_protocol
218
249
expect ( @patient_nasal_only . vaccination_records . first . protocol ) . to eq ( "psd" )
219
250
end
251
+
252
+ def and_the_vaccination_record_has_pdg_as_the_protocol
253
+ expect ( @patient_nasal_only . vaccination_records . first . protocol ) . to eq ( "pgd" )
254
+ end
220
255
end
0 commit comments