diff options
Diffstat (limited to 'spec/requests/api/composer_packages_spec.rb')
-rw-r--r-- | spec/requests/api/composer_packages_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/requests/api/composer_packages_spec.rb b/spec/requests/api/composer_packages_spec.rb index ef4682466d5..06d4a2c6017 100644 --- a/spec/requests/api/composer_packages_spec.rb +++ b/spec/requests/api/composer_packages_spec.rb @@ -167,7 +167,8 @@ RSpec.describe API::ComposerPackages do describe 'GET /api/v4/group/:id/-/packages/composer/*package_name.json' do let(:package_name) { 'foobar' } - let(:url) { "/group/#{group.id}/-/packages/composer/#{package_name}.json" } + let(:sha) { '$1234' } + let(:url) { "/group/#{group.id}/-/packages/composer/#{package_name}#{sha}.json" } subject { get api(url), headers: headers } @@ -206,6 +207,16 @@ RSpec.describe API::ComposerPackages do it_behaves_like params[:shared_examples_name], params[:user_role], params[:expected_status], params[:member] end end + + context 'without a sha' do + let(:sha) { '' } + + include_context 'Composer api group access', 'PRIVATE', :developer, true do + include_context 'Composer user type', :developer, true do + it_behaves_like 'process Composer api request', :developer, :not_found, true + end + end + end end it_behaves_like 'rejects Composer access with unknown group id' |