|
14 | 14 | then_i_see_the_consent_page |
15 | 15 |
|
16 | 16 | when_i_refuse_consent |
| 17 | + then_i_see_the_follow_up_question |
| 18 | + when_i_request_follow_up |
17 | 19 | then_i_can_check_my_answers |
18 | 20 |
|
| 21 | + when_i_change_my_refusal_reason |
| 22 | + then_the_consent_doesnt_have_follow_up_requested_stored |
| 23 | + |
19 | 24 | when_i_confirm_my_answers |
20 | 25 | and_i_refuse_to_answer_questions_on_ethnicity |
21 | 26 | then_i_see_the_confirmation_page |
@@ -91,14 +96,33 @@ def when_i_refuse_consent |
91 | 96 | ) |
92 | 97 | fill_in "Give details", with: "They have a weakened immune system" |
93 | 98 | click_on "Continue" |
| 99 | + end |
94 | 100 |
|
| 101 | + def then_i_see_the_follow_up_question |
95 | 102 | expect(page).to have_content( |
96 | 103 | "Would you like a member of the team to contact you to discuss alternative options?" |
97 | 104 | ) |
98 | | - choose "No" |
| 105 | + end |
| 106 | + |
| 107 | + def when_i_request_follow_up |
| 108 | + choose "Yes, I would like someone to contact me" |
99 | 109 | click_on "Continue" |
100 | 110 | end |
101 | 111 |
|
| 112 | + def when_i_change_my_refusal_reason |
| 113 | + click_on "Change reason for refusal" |
| 114 | + choose "Vaccine already received" |
| 115 | + click_on "Continue" |
| 116 | + |
| 117 | + fill_in "Give details", |
| 118 | + with: "They will receive the vaccine at another location" |
| 119 | + click_on "Continue" |
| 120 | + end |
| 121 | + |
| 122 | + def then_the_consent_doesnt_have_follow_up_requested_stored |
| 123 | + expect(ConsentForm.last.follow_up_requested).to be_nil |
| 124 | + end |
| 125 | + |
102 | 126 | def when_i_refuse_consent_and_request_follow_up |
103 | 127 | expect(page).to have_content("Do you agree") |
104 | 128 | choose "No" |
|
0 commit comments