From cbf163089adbf39da71e207f3ccc733f83904776 Mon Sep 17 00:00:00 2001 From: Chris Zetter <253059100+zetter-rpf@users.noreply.github.com> Date: Mon, 19 Jan 2026 16:06:55 +0000 Subject: [PATCH] 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 --- spec/concepts/school_student/list_spec.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/spec/concepts/school_student/list_spec.rb b/spec/concepts/school_student/list_spec.rb index 72c199c24..20ad7a5a4 100644 --- a/spec/concepts/school_student/list_spec.rb +++ b/spec/concepts/school_student/list_spec.rb @@ -24,7 +24,11 @@ described_class.call(school:, token:) # TODO: Replace with WebMock assertion once the profile API has been built. - expect(ProfileApiClient).to have_received(:list_school_students).with(token:, school_id: school.id, student_ids: students.map(&:id)) + expect(ProfileApiClient).to have_received(:list_school_students).with( + token:, + school_id: school.id, + student_ids: match_array(students.map(&:id)) + ) end it 'returns a school students JSON array' do @@ -61,7 +65,11 @@ described_class.call(school:, token:, student_ids:) # TODO: Replace with WebMock assertion once the profile API has been built. - expect(ProfileApiClient).to have_received(:list_school_students).with(token:, school_id: school.id, student_ids:) + expect(ProfileApiClient).to have_received(:list_school_students).with( + token:, + school_id: school.id, + student_ids: match_array(student_ids) + ) end it 'returns a filtered school students JSON array' do