diff options
Diffstat (limited to 'spec/services/releases/update_service_spec.rb')
-rw-r--r-- | spec/services/releases/update_service_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/services/releases/update_service_spec.rb b/spec/services/releases/update_service_spec.rb index 932a7fab5ec..96b562a8071 100644 --- a/spec/services/releases/update_service_spec.rb +++ b/spec/services/releases/update_service_spec.rb @@ -38,6 +38,21 @@ RSpec.describe Releases::UpdateService do service.execute end + context 'when tag is protected and user does not have access to it' do + let!(:protected_tag) { create(:protected_tag, :no_one_can_create, name: '*', project: project) } + + it 'track the error event' do + stub_feature_flags(evalute_protected_tag_for_release_permissions: false) + + expect(Gitlab::ErrorTracking).to receive(:log_exception).with( + kind_of(described_class::ReleaseProtectedTagAccessError), + project_id: project.id, + user_id: user.id) + + service.execute + end + end + context 'when the tag does not exists' do let(:tag_name) { 'foobar' } |