From 9de54635ed1e625e46382cd97b751ca384bd6a1d Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 2 Feb 2026 10:11:15 -0500 Subject: [PATCH] Add coverage for "too many IDs" scenario in `api/v1/statuses` (#37699) --- spec/requests/api/v1/statuses_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/requests/api/v1/statuses_spec.rb b/spec/requests/api/v1/statuses_spec.rb index 3fbf26c54a7..be227e801e4 100644 --- a/spec/requests/api/v1/statuses_spec.rb +++ b/spec/requests/api/v1/statuses_spec.rb @@ -25,6 +25,19 @@ RSpec.describe '/api/v1/statuses' do hash_including(id: other_status.id.to_s) ) end + + context 'with too many IDs' do + before { stub_const 'Api::BaseController::DEFAULT_STATUSES_LIMIT', 2 } + + it 'returns error response' do + get '/api/v1/statuses', headers: headers, params: { id: [123, 456, 789] } + + expect(response) + .to have_http_status(422) + expect(response.content_type) + .to start_with('application/json') + end + end end describe 'GET /api/v1/statuses/:id' do