11# frozen_string_literal: true
22
33describe "Verbal consent" do
4- scenario "Given" do
4+ scenario "Given HPV " do
55 given_an_hpv_programme_is_underway
66 and_i_am_signed_in
7+
78 when_i_record_that_verbal_consent_was_given
89 then_an_email_is_sent_to_the_parent_confirming_their_consent
910 and_a_text_is_sent_to_the_parent_confirming_their_consent
1011 and_the_patients_status_is_safe_to_vaccinate
1112 and_i_can_see_the_consent_response_details
1213 end
1314
14- scenario "Given flu nasal consent " do
15+ scenario "Given flu nasal spray " do
1516 given_an_flu_programme_is_underway
1617 and_i_am_signed_in
18+
1719 when_i_record_that_verbal_nasal_consent_was_given
1820 and_the_patients_status_is_safe_to_vaccinate_with_nasal_spray
1921 end
2022
23+ scenario "Given flu nasal spray and injection" do
24+ given_an_flu_programme_is_underway
25+ and_i_am_signed_in
26+
27+ when_i_record_that_verbal_nasal_and_injection_consent_was_given
28+ end
29+
2130 def given_an_hpv_programme_is_underway
2231 create_programme ( :hpv )
2332 end
@@ -41,19 +50,32 @@ def create_programme(programme_type)
4150 end
4251
4352 def when_i_record_that_verbal_consent_was_given
44- record_that_verbal_consent_was_given ( consent_option : "Yes, they agree" )
53+ record_that_verbal_consent_was_given (
54+ consent_option : "Yes, they agree" ,
55+ number_of_health_questions : 4
56+ )
4557 end
4658
4759 def when_i_record_that_verbal_nasal_consent_was_given
4860 record_that_verbal_consent_was_given (
4961 consent_option : "Yes, for the nasal spray" ,
62+ number_of_health_questions : 9 ,
63+ triage_option : "Yes, it’s safe to vaccinate with nasal spray"
64+ )
65+ end
66+
67+ def when_i_record_that_verbal_nasal_and_injection_consent_was_given
68+ record_that_verbal_consent_was_given (
69+ consent_option : "Yes, for the nasal spray" ,
70+ number_of_health_questions : 10 ,
5071 triage_option : "Yes, it’s safe to vaccinate with nasal spray" ,
5172 injective_alternative : true
5273 )
5374 end
5475
5576 def record_that_verbal_consent_was_given (
5677 consent_option :,
78+ number_of_health_questions :,
5779 triage_option : "Yes, it’s safe to vaccinate" ,
5880 injective_alternative : false
5981 )
@@ -86,11 +108,9 @@ def record_that_verbal_consent_was_given(
86108 if consent_option . include? ( "nasal" )
87109 choose injective_alternative ? "Yes" : "No"
88110 end
89-
90111 click_button "Continue"
91112
92- # assumes all vaccines in the programme have the same questions
93- @programme . vaccines . first . health_questions . size . times do |index |
113+ number_of_health_questions . times do |index |
94114 find_all ( ".nhsuk-fieldset" ) [ index ] . choose "No"
95115 end
96116
0 commit comments