diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-01-10 19:39:42 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-01-10 23:55:39 +0300 |
commit | f216d60bebadf9f4b2aed5df0dc18e2e83865f98 (patch) | |
tree | 80971afcaa00fe14ae69f227acde44ef6e28960d /spec/support/helpers | |
parent | a9e6ba11a24158dcd8f7cca9c7cd198764448f13 (diff) |
Refactor epics/issues API specs
Refactor the epics/issues API specs to remove code duplication.
Diffstat (limited to 'spec/support/helpers')
-rw-r--r-- | spec/support/helpers/api_helpers.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/support/helpers/api_helpers.rb b/spec/support/helpers/api_helpers.rb index a57a3b2cf34..4a9ce9beb78 100644 --- a/spec/support/helpers/api_helpers.rb +++ b/spec/support/helpers/api_helpers.rb @@ -36,4 +36,11 @@ module ApiHelpers full_path end + + def expect_paginated_array_response(items) + expect(response).to have_gitlab_http_status(200) + expect(response).to include_pagination_headers + expect(json_response).to be_an Array + expect(json_response.map { |item| item['id'] }).to eq(Array(items)) + end end |