71
71
then_i_do_not_see_the_register_tab
72
72
end
73
73
74
+ scenario "Viewing a patient from yesterday with attendance turned off" do
75
+ given_my_team_is_running_an_hpv_vaccination_programme
76
+ and_there_is_a_vaccination_session_yesterday_that_requires_no_registration
77
+ and_the_session_has_patients
78
+
79
+ when_i_go_to_the_session
80
+ and_i_click_on_the_record_tab
81
+ then_i_cant_see_the_patients
82
+
83
+ when_i_go_to_the_session
84
+ and_i_click_on_the_children_tab
85
+ and_i_go_to_a_patient
86
+ then_i_cant_record_a_vaccination
87
+ end
88
+
74
89
def given_my_team_is_running_an_hpv_vaccination_programme
75
90
@programmes = [ create ( :programme , :hpv_all_vaccines ) ]
76
- @team = create ( :team , :with_one_nurse , programmes : @programmes )
91
+ @team =
92
+ create (
93
+ :team ,
94
+ :with_one_nurse ,
95
+ :with_generic_clinic ,
96
+ programmes : @programmes
97
+ )
77
98
end
78
99
79
100
def and_there_is_a_vaccination_session_today
80
- location = create ( :school , team : @team )
81
101
@session =
82
- create ( :session , :today , programmes : @programmes , team : @team , location :)
102
+ create (
103
+ :session ,
104
+ :today ,
105
+ programmes : @programmes ,
106
+ team : @team ,
107
+ location : create ( :school , team : @team )
108
+ )
83
109
end
84
110
85
111
def and_there_is_a_vaccination_session_today_that_requires_no_registration
86
- location = create ( :school , team : @team )
87
112
@session =
88
113
create (
89
114
:session ,
90
115
:today ,
91
116
:requires_no_registration ,
92
117
programmes : @programmes ,
93
118
team : @team ,
94
- location :
119
+ location : create ( :school , team : @team )
120
+ )
121
+ end
122
+
123
+ def and_there_is_a_vaccination_session_yesterday_that_requires_no_registration
124
+ @session =
125
+ create (
126
+ :session ,
127
+ :yesterday ,
128
+ :requires_no_registration ,
129
+ programmes : @programmes ,
130
+ team : @team ,
131
+ location : create ( :school , team : @team )
95
132
)
96
133
end
97
134
@@ -112,18 +149,28 @@ def when_i_go_to_the_session
112
149
click_link @session . location . name
113
150
end
114
151
152
+ def and_i_click_on_the_children_tab
153
+ within ( ".app-secondary-navigation" ) { click_on "Children" }
154
+ end
155
+
115
156
def and_i_click_on_the_register_tab
116
157
click_link "Register"
117
158
end
118
159
119
- def when_i_click_on_the_record_vaccinations_tab
160
+ def and_i_click_on_the_record_tab
120
161
click_link "Record vaccinations"
121
162
end
122
163
123
164
def then_i_do_not_see_the_register_tab
124
165
expect ( page ) . not_to have_content ( "Register" )
125
166
end
126
167
168
+ def then_i_cant_see_the_patients
169
+ expect ( page ) . to have_content (
170
+ "You can record vaccinations when a session is in progress."
171
+ )
172
+ end
173
+
127
174
def then_i_should_not_see_link_to_update_attendance
128
175
expect ( page ) . not_to have_content ( "Update attendance" )
129
176
end
@@ -226,4 +273,8 @@ def and_i_turn_off_register_attendance
226
273
choose "No"
227
274
click_on "Continue"
228
275
end
276
+
277
+ def then_i_cant_record_a_vaccination
278
+ expect ( page ) . not_to have_content ( "Record vaccination" )
279
+ end
229
280
end
0 commit comments