Skip to content

Commit 3fd0b19

Browse files
committed
Fix tests failing due to underfined ordering
This test is failing in [1] because the student ids were in a different order. Make sure the test accepts ids in any order. [1] - https://app.circleci.com/pipelines/github/RaspberryPiFoundation/editor-api/2948/workflows/88d009c2-3b67-46a9-8dc5-cc248bfe5df0/jobs/5600?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-checks-link&utm_content=summary
1 parent 8f39c7c commit 3fd0b19

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

spec/concepts/school_student/list_spec.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
described_class.call(school:, token:)
2525

2626
# TODO: Replace with WebMock assertion once the profile API has been built.
27-
expect(ProfileApiClient).to have_received(:list_school_students).with(token:, school_id: school.id, student_ids: students.map(&:id))
27+
expect(ProfileApiClient).to have_received(:list_school_students).with(
28+
token:,
29+
school_id: school.id,
30+
student_ids: match_array(students.map(&:id))
31+
)
2832
end
2933

3034
it 'returns a school students JSON array' do
@@ -61,7 +65,11 @@
6165
described_class.call(school:, token:, student_ids:)
6266

6367
# TODO: Replace with WebMock assertion once the profile API has been built.
64-
expect(ProfileApiClient).to have_received(:list_school_students).with(token:, school_id: school.id, student_ids:)
68+
expect(ProfileApiClient).to have_received(:list_school_students).with(
69+
token:,
70+
school_id: school.id,
71+
student_ids: match_array(student_ids)
72+
)
6573
end
6674

6775
it 'returns a filtered school students JSON array' do

0 commit comments

Comments
 (0)