diff options
Diffstat (limited to 'spec/support/shared_examples/requests/api/helm_packages_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/requests/api/helm_packages_shared_examples.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/support/shared_examples/requests/api/helm_packages_shared_examples.rb b/spec/support/shared_examples/requests/api/helm_packages_shared_examples.rb index 7803f0ff04d..9c20b95eb80 100644 --- a/spec/support/shared_examples/requests/api/helm_packages_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/helm_packages_shared_examples.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.shared_examples 'rejects helm packages access' do |user_type, status| +RSpec.shared_examples 'rejects helm packages access' do |user_type, status, body| context "for user type #{user_type}" do before do project.send("add_#{user_type}", user) if user_type != :anonymous && user_type != :not_a_member @@ -15,6 +15,14 @@ RSpec.shared_examples 'rejects helm packages access' do |user_type, status| expect(response.headers['WWW-Authenticate']).to eq 'Basic realm="GitLab Packages Registry"' end end + + if body + it 'has the correct body' do + subject + + expect(response.body).to eq(body) + end + end end end |