|
4 | 4 | before { Flipper.enable(:release_1b) }
|
5 | 5 | after { Flipper.disable(:release_1b) }
|
6 | 6 |
|
7 |
| - scenario "No consent from parent, the child is Gillick competent so can self-consent" do |
| 7 | + scenario "From Gillick assessment" do |
8 | 8 | given_an_hpv_programme_is_underway
|
9 | 9 | and_there_is_a_child_without_parental_consent
|
10 | 10 |
|
11 | 11 | when_the_nurse_assesses_the_child_as_not_being_gillick_competent
|
12 |
| - and_the_details_of_the_gillick_non_competence_assessment_are_visible |
13 |
| - then_the_nurse_assesses_the_child_as_gillick_competent |
14 |
| - then_the_child_can_give_their_own_consent_that_the_nurse_records |
| 12 | + then_the_details_of_the_gillick_non_competence_assessment_are_visible |
| 13 | + and_the_child_cannot_give_their_own_consent |
| 14 | + and_the_child_status_reflects_that_there_is_no_consent |
| 15 | + and_the_activity_log_shows_the_gillick_non_competence |
| 16 | + |
| 17 | + when_the_nurse_edits_the_assessment_the_child_as_gillick_competent |
| 18 | + then_the_details_of_the_gillick_competence_assessment_are_visible |
| 19 | + and_the_activity_log_shows_the_gillick_non_competence |
| 20 | + and_the_activity_log_shows_the_gillick_competence |
| 21 | + and_the_child_can_give_their_own_consent_that_the_nurse_records |
15 | 22 |
|
16 | 23 | when_the_nurse_views_the_childs_record
|
17 | 24 | then_they_see_that_the_child_has_consent
|
18 | 25 | and_the_child_should_be_safe_to_vaccinate
|
19 | 26 | end
|
20 | 27 |
|
21 |
| - scenario "No consent from parent, the child is not Gillick competent" do |
22 |
| - given_an_hpv_programme_is_underway |
23 |
| - and_there_is_a_child_without_parental_consent |
24 |
| - |
25 |
| - when_the_nurse_assesses_the_child_as_gillick_competent |
26 |
| - and_the_details_of_the_gillick_competence_assessment_are_visible |
27 |
| - then_the_nurse_assesses_the_child_as_not_being_gillick_competent |
28 |
| - then_the_child_cannot_give_their_own_consent |
29 |
| - and_the_childs_status_reflects_that_there_is_no_consent |
30 |
| - end |
31 |
| - |
32 | 28 | def given_an_hpv_programme_is_underway
|
33 | 29 | programme = create(:programme, :hpv)
|
34 | 30 | @organisation =
|
@@ -65,93 +61,121 @@ def and_there_is_a_child_without_parental_consent
|
65 | 61 | expect(page).to have_content(@patient.full_name)
|
66 | 62 | end
|
67 | 63 |
|
68 |
| - def when_the_nurse_assesses_the_child_as_gillick_competent |
| 64 | + def when_the_nurse_assesses_the_child_as_not_being_gillick_competent |
69 | 65 | click_on @patient.full_name
|
70 | 66 | click_on "Assess Gillick competence"
|
71 |
| - fill_in_as_competent |
72 |
| - click_on "Complete your assessment" |
73 |
| - end |
74 |
| - |
75 |
| - def then_the_nurse_assesses_the_child_as_gillick_competent |
76 |
| - click_on "Edit Gillick competence" |
77 |
| - fill_in_as_competent |
78 |
| - click_on "Update your assessment" |
79 |
| - end |
80 | 67 |
|
81 |
| - def fill_in_as_competent |
82 | 68 | within(
|
83 | 69 | "fieldset",
|
84 | 70 | text: "The child knows which vaccination they will have"
|
85 |
| - ) { choose "Yes" } |
| 71 | + ) { choose "No" } |
86 | 72 |
|
87 | 73 | within(
|
88 | 74 | "fieldset",
|
89 | 75 | text: "The child knows which disease the vaccination protects against"
|
90 |
| - ) { choose "Yes" } |
| 76 | + ) { choose "No" } |
91 | 77 |
|
92 | 78 | within(
|
93 | 79 | "fieldset",
|
94 | 80 | text: "The child knows what could happen if they got the disease"
|
95 |
| - ) { choose "Yes" } |
| 81 | + ) { choose "No" } |
96 | 82 |
|
97 | 83 | within(
|
98 | 84 | "fieldset",
|
99 | 85 | text: "The child knows how the injection will be given"
|
100 |
| - ) { choose "Yes" } |
| 86 | + ) { choose "No" } |
101 | 87 |
|
102 | 88 | within(
|
103 | 89 | "fieldset",
|
104 | 90 | text: "The child knows which side effects they might experience"
|
105 |
| - ) { choose "Yes" } |
| 91 | + ) { choose "No" } |
106 | 92 |
|
107 | 93 | fill_in "Assessment notes (optional)",
|
108 |
| - with: "They understand the benefits and risks of the vaccine" |
109 |
| - end |
| 94 | + with: "They didn't understand the benefits and risks of the vaccine" |
110 | 95 |
|
111 |
| - def when_the_nurse_assesses_the_child_as_not_being_gillick_competent |
112 |
| - click_on @patient.full_name |
113 |
| - click_on "Assess Gillick competence" |
114 |
| - fill_in_as_non_competent |
115 | 96 | click_on "Complete your assessment"
|
116 | 97 | end
|
117 | 98 |
|
118 |
| - def then_the_nurse_assesses_the_child_as_not_being_gillick_competent |
119 |
| - click_on "Edit Gillick competence" |
120 |
| - fill_in_as_non_competent |
121 |
| - click_on "Update your assessment" |
| 99 | + def then_the_details_of_the_gillick_non_competence_assessment_are_visible |
| 100 | + expect(page).to have_content("Child assessed as not Gillick competent") |
| 101 | + expect(page).to have_content( |
| 102 | + "They didn't understand the benefits and risks of the vaccine" |
| 103 | + ) |
122 | 104 | end
|
123 | 105 |
|
124 |
| - def fill_in_as_non_competent |
| 106 | + def and_the_child_cannot_give_their_own_consent |
| 107 | + click_on "Get consent" |
| 108 | + expect(page).not_to have_content("Child (Gillick competent)") |
| 109 | + click_on "Back" |
| 110 | + end |
| 111 | + |
| 112 | + def and_the_child_status_reflects_that_there_is_no_consent |
| 113 | + expect(page).to have_content("No response") |
| 114 | + end |
| 115 | + |
| 116 | + def and_the_activity_log_shows_the_gillick_non_competence |
| 117 | + click_on "Activity log" |
| 118 | + expect(page).to have_content( |
| 119 | + "Completed Gillick assessment as not Gillick competent" |
| 120 | + ) |
| 121 | + click_on "Child record" |
| 122 | + end |
| 123 | + |
| 124 | + def when_the_nurse_edits_the_assessment_the_child_as_gillick_competent |
| 125 | + click_on "Edit Gillick competence" |
| 126 | + |
| 127 | + # notes from previous assessment |
| 128 | + expect(page).to have_content( |
| 129 | + "They didn't understand the benefits and risks of the vaccine" |
| 130 | + ) |
| 131 | + |
125 | 132 | within(
|
126 | 133 | "fieldset",
|
127 | 134 | text: "The child knows which vaccination they will have"
|
128 |
| - ) { choose "No" } |
| 135 | + ) { choose "Yes" } |
129 | 136 |
|
130 | 137 | within(
|
131 | 138 | "fieldset",
|
132 | 139 | text: "The child knows which disease the vaccination protects against"
|
133 |
| - ) { choose "No" } |
| 140 | + ) { choose "Yes" } |
134 | 141 |
|
135 | 142 | within(
|
136 | 143 | "fieldset",
|
137 | 144 | text: "The child knows what could happen if they got the disease"
|
138 |
| - ) { choose "No" } |
| 145 | + ) { choose "Yes" } |
139 | 146 |
|
140 | 147 | within(
|
141 | 148 | "fieldset",
|
142 | 149 | text: "The child knows how the injection will be given"
|
143 |
| - ) { choose "No" } |
| 150 | + ) { choose "Yes" } |
144 | 151 |
|
145 | 152 | within(
|
146 | 153 | "fieldset",
|
147 | 154 | text: "The child knows which side effects they might experience"
|
148 |
| - ) { choose "No" } |
| 155 | + ) { choose "Yes" } |
149 | 156 |
|
150 | 157 | fill_in "Assessment notes (optional)",
|
151 |
| - with: "They didn't understand the benefits and risks of the vaccine" |
| 158 | + with: "They understand the benefits and risks of the vaccine" |
| 159 | + |
| 160 | + click_on "Update your assessment" |
| 161 | + end |
| 162 | + |
| 163 | + def then_the_details_of_the_gillick_competence_assessment_are_visible |
| 164 | + expect(page).to have_content("Child assessed as Gillick competent") |
| 165 | + expect(page).to have_content( |
| 166 | + "They understand the benefits and risks of the vaccine" |
| 167 | + ) |
152 | 168 | end
|
153 | 169 |
|
154 |
| - def then_the_child_can_give_their_own_consent_that_the_nurse_records |
| 170 | + def and_the_activity_log_shows_the_gillick_competence |
| 171 | + click_on "Activity log" |
| 172 | + expect(page).to have_content( |
| 173 | + "Updated Gillick assessment as Gillick competent" |
| 174 | + ) |
| 175 | + click_on "Child record" |
| 176 | + end |
| 177 | + |
| 178 | + def and_the_child_can_give_their_own_consent_that_the_nurse_records |
155 | 179 | click_on "Get consent"
|
156 | 180 |
|
157 | 181 | # who
|
@@ -191,33 +215,7 @@ def then_they_see_that_the_child_has_consent
|
191 | 215 | expect(page).to have_content("Consent given")
|
192 | 216 | end
|
193 | 217 |
|
194 |
| - def and_the_details_of_the_gillick_competence_assessment_are_visible |
195 |
| - expect(page).to have_content("Child assessed as Gillick competent") |
196 |
| - expect(page).to have_content( |
197 |
| - "They understand the benefits and risks of the vaccine" |
198 |
| - ) |
199 |
| - end |
200 |
| - |
201 |
| - def and_the_details_of_the_gillick_non_competence_assessment_are_visible |
202 |
| - expect(page).to have_content("Child assessed as not Gillick competent") |
203 |
| - expect(page).to have_content( |
204 |
| - "They didn't understand the benefits and risks of the vaccine" |
205 |
| - ) |
206 |
| - end |
207 |
| - |
208 | 218 | def and_the_child_should_be_safe_to_vaccinate
|
209 | 219 | expect(page).to have_content("Safe to vaccinate")
|
210 | 220 | end
|
211 |
| - |
212 |
| - def then_the_child_cannot_give_their_own_consent |
213 |
| - click_on "Get consent" |
214 |
| - |
215 |
| - expect(page).not_to have_content("Child (Gillick competent)") |
216 |
| - |
217 |
| - click_on "Back" |
218 |
| - end |
219 |
| - |
220 |
| - def and_the_childs_status_reflects_that_there_is_no_consent |
221 |
| - expect(page).to have_content("No response") |
222 |
| - end |
223 | 221 | end
|
0 commit comments