Refactor spec/requests/api/todos_spec.rb to reduce memoized helpers
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=535006) </details> <!--IssueSummary end--> The following discussion from !186933 should be addressed: - [ ] @knejad started a [discussion](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/186933#note_2439680802): > There are a lot of memoized helpers here (hence why you disabled the cop), and I think it would make sense to refactor the specs to cut this down, since it's also making some of the specs harder to read and maintain (e.g. having to change all the `json_response[n]` checks and it not being clear why e.g. 4 is `'WikiPage::Meta'`). > > It's out of scope for this MR, but I wonder if now that the cop has to be disabled, if it's a good time to create a follow up MR to refactor this so that different contexts test different types of todos?
issue