Skip to content

Refactor spec/requests/api/todos_spec.rb to reduce memoized helpers

The following discussion from !186933 (merged) should be addressed:

  • @knejad started a discussion:

    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?