Loading
Tighten specs for the to-do list API rate limit
What does this MR do and why?
Follow-up to review feedback on !265469 (merged), which added the todos_list_api_limit rate limit for GET /api/v4/todos. Spec-only change.
- Removes the "when the limit is disabled in application settings" context from
spec/requests/api/todos_spec.rb. It sent 3 requests with the limit set to0, which would also pass under the default of 300, so it didn't prove that0disables the limit. That case is already covered by the'rate limited endpoint'shared example ("when rate limiter is disabled"), and the "when the limit is reached" context covers reading the setting. (!265469 (comment 4112899234)) - Adds
todos_list_api_limitto thevalidate_numericality_of ... is_greater_than_or_equal_to(0)list inspec/models/application_setting_spec.rb, so the model validation is asserted. (!265469 (comment 4112899260))
References
Screenshots or screen recordings
Not applicable, spec-only change.
How to set up and validate locally
Not applicable, spec-only change.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.