diff --git a/spec/features/manage_attendance_spec.rb b/spec/features/manage_attendance_spec.rb index 1e63b52cb..d0ff36b85 100644 --- a/spec/features/manage_attendance_spec.rb +++ b/spec/features/manage_attendance_spec.rb @@ -94,7 +94,12 @@ def when_i_register_a_patient_as_absent end def when_i_go_to_a_patient - click_link @session.reload.patients.last.full_name + click_link PatientSession + .where + .missing(:session_attendances) + .find_by(session: @session) + .patient + .full_name end def then_the_patient_is_not_registered_yet