Skip to content

Commit c305c22

Browse files
committed
Add test to check that a teacher cannot batch-delete students.
1 parent 4e416cb commit c305c22

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

spec/features/school_student/batch_deleting_school_students_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@
4747
expect(Project.where(id: project_2.id)).not_to exist
4848
end
4949

50+
it 'responds 403 Forbidden when the user is a school-teacher' do
51+
authenticated_in_hydra_as(teacher)
52+
53+
delete "/api/schools/#{school.id}/students/batch",
54+
params: { student_ids: [student_1.id, student_2.id] },
55+
headers: headers
56+
57+
expect(response).to have_http_status(:forbidden)
58+
end
59+
5060
it 'returns error when no student IDs provided' do
5161
delete "/api/schools/#{school.id}/students/batch",
5262
headers: headers

0 commit comments

Comments
 (0)