summaryrefslogtreecommitdiff
path: root/spec/support/helpers/api_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/helpers/api_helpers.rb')
-rw-r--r--spec/support/helpers/api_helpers.rb11
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