Follow-up from "Add pagination to epics API"

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

  • @dbalexandre started a discussion: (+1 comment)

    What do you think to move this helper method into EE::ApiHelpers and reuse it on https://gitlab.com/gitlab-org/gitlab-ee/blob/master/ee/spec/requests/api/issues_spec.rb to avoid code duplication?

    module EE
      module APIHelpers
        def expect_paginated_array_response(expected, size: nil)
          expect(response).to have_gitlab_http_status(200)
          expect(response).to include_pagination_headers
          expect(json_response).to be_an Array
          expect(json_response.length).to eq(size) if size
          expect(json_response.map { |item| item['id'] }).to eq(Array(expected))
        end
      end
    end
Assignee Loading
Time tracking Loading