debian-mirror-gitlab/spec/support/shared_contexts/lib/gitlab/git_access_shared_examples.rb
2020-10-24 23:57:45 +05:30

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