Skip to content

Commit 605ffcd

Browse files
authored
Merge pull request #4667 from nhsuk/fix-invite-to-clinic
Import test coverage for invite to clinic
2 parents fcb9e41 + 8a824da commit 605ffcd

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

spec/features/manage_school_sessions_spec.rb

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,28 @@ def given_my_team_is_running_an_hpv_vaccination_programme
105105

106106
clinic_session.set_notification_dates
107107
clinic_session.save!
108+
109+
patient_already_in_clinic_without_invitiation =
110+
create(:patient, year_group: 8, session: @session)
111+
create(
112+
:patient_location,
113+
patient: patient_already_in_clinic_without_invitiation,
114+
session: clinic_session
115+
)
116+
117+
patient_already_in_clinic_with_invitiation =
118+
create(:patient, year_group: 8, session: @session)
119+
create(
120+
:patient_location,
121+
patient: patient_already_in_clinic_with_invitiation,
122+
session: clinic_session
123+
)
124+
create(
125+
:session_notification,
126+
:clinic_initial_invitation,
127+
session: clinic_session,
128+
patient: patient_already_in_clinic_with_invitiation
129+
)
108130
end
109131

110132
def and_i_am_signed_in
@@ -153,7 +175,7 @@ def then_i_see_the_school_session
153175
end
154176

155177
def and_i_see_a_child_in_the_cohort
156-
expect(page).to have_content("1 child")
178+
expect(page).to have_content("3 children")
157179
end
158180

159181
def when_i_click_on_schedule_sessions
@@ -291,15 +313,15 @@ def when_i_click_on_send_invitations
291313
def then_i_see_the_send_invitations_page
292314
expect(page).to have_content("Invite parents to book a clinic appointment")
293315
expect(page).to have_content(
294-
"There is 1 child currently without clinic appointments."
316+
"There are 2 children currently without clinic appointments."
295317
)
296318
end
297319

298320
alias_method :and_i_click_on_send_invitations,
299321
:when_i_click_on_send_invitations
300322

301323
def then_i_see_the_invitation_confirmation
302-
expect(page).to have_content("1 child invited to the clinic")
324+
expect(page).to have_content("2 children invited to the clinic")
303325
end
304326

305327
def and_the_parent_receives_an_invitation

0 commit comments

Comments
 (0)