|
13 | 13 | consents: patient.consents, |
14 | 14 | triages: patient.triages, |
15 | 15 | attendance_record: patient.attendance_records.first, |
16 | | - vaccination_records: patient.vaccination_records.order_by_performed_at |
| 16 | + vaccination_records: patient.vaccination_records.order_by_performed_at, |
| 17 | + parents: patient.parents.contactable |
17 | 18 | ) |
18 | 19 | end |
19 | 20 |
|
20 | 21 | let(:programme) { Programme.sample } |
21 | 22 | let(:session) { create(:session, programmes: [programme]) } |
22 | | - let(:patient) { create(:patient, session:) } |
| 23 | + let(:patient) { create(:patient, session:, parents:) } |
| 24 | + let(:parents) { [create(:parent)] } |
23 | 25 | let(:location) { create(:school) } |
24 | 26 |
|
25 | 27 | context "when already vaccinated" do |
|
368 | 370 | its(:vaccine_methods) { should be_nil } |
369 | 371 | its(:without_gelatine) { should be_nil } |
370 | 372 |
|
| 373 | + context "when there are no contact details for parents and no consent request has been sent" do |
| 374 | + let(:parents) { [create(:parent, :non_contactable)] } |
| 375 | + |
| 376 | + its(:status) { should be(:needs_consent_no_contact_details) } |
| 377 | + end |
| 378 | + |
| 379 | + context "when there are no parent relationships and no consent request has been sent" do |
| 380 | + let(:parents) { [] } |
| 381 | + |
| 382 | + its(:status) { should be(:needs_consent_no_contact_details) } |
| 383 | + end |
| 384 | + |
371 | 385 | context "with a multi-dose programme" do |
372 | 386 | let(:programme) { Programme.mmr } |
373 | 387 |
|
|
0 commit comments