gitlab-org--gitlab-foss/spec/support/shared_contexts/lib/gitlab/git_access_shared_examples.rb

18 lines
429 B
Ruby

# frozen_string_literal: true
RSpec.shared_examples 'forbidden git access' do
let(:message) { /You can't/ }
it 'prevents access' do
expect { subject }.to raise_error(Gitlab::GitAccess::ForbiddenError, message)
end
end
RSpec.shared_examples 'not-found git access' do
let(:message) { /not found/ }
it 'prevents access' do
expect { subject }.to raise_error(Gitlab::GitAccess::NotFoundError, message)
end
end