Commit 41b12044 authored by charlie ablett's avatar charlie ablett

Merge branch 'refactor-composer-api-group-checks' into 'master'

Refactor composer api group checks

See merge request gitlab-org/gitlab!38642
parents 50192cda 2104c924
This diff is collapsed.
......@@ -7,13 +7,17 @@ RSpec.shared_context 'Composer user type' do |user_type, add_member|
end
end
RSpec.shared_examples 'Composer package index' do |user_type, status, add_member = true|
RSpec.shared_examples 'Composer package index' do |user_type, status, add_member, include_package|
include_context 'Composer user type', user_type, add_member do
let(:expected_packages) { include_package == :include_package ? [package] : [] }
let(:presenter) { ::Packages::Composer::PackagesPresenter.new(group, expected_packages ) }
it 'returns the package index' do
subject
expect(response).to have_gitlab_http_status(status)
expect(response).to match_response_schema('public_api/v4/packages/composer/index')
expect(json_response).to eq presenter.root
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment