diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-14 00:08:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-14 00:08:59 +0300 |
commit | d466ee5042520ad078fe050cb078d81dc2ebe196 (patch) | |
tree | 5648eb1aee8aeff5b5c5ff4669a184fd7676f778 /spec/support | |
parent | 6a9d7c009e4e5975a89bcc3e458da4b3ec484bd1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/helpers/api_helpers.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/support/helpers/api_helpers.rb b/spec/support/helpers/api_helpers.rb index 4bf6a17c03e..44c38df71b0 100644 --- a/spec/support/helpers/api_helpers.rb +++ b/spec/support/helpers/api_helpers.rb @@ -40,6 +40,17 @@ module ApiHelpers end end + def expect_empty_array_response + expect_successful_response_with_paginated_array + expect(json_response.length).to eq(0) + end + + def expect_successful_response_with_paginated_array + expect(response).to have_gitlab_http_status(:ok) + expect(response).to include_pagination_headers + expect(json_response).to be_an Array + end + def expect_paginated_array_response(items) expect(response).to have_gitlab_http_status(:ok) expect(response).to include_pagination_headers |