diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-23 03:05:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-23 03:05:37 +0300 |
commit | d4ba3c22bf2b63e606f87cf87082b7a9aa5e8581 (patch) | |
tree | aa0ff4e7bbdab7928ec2c5dbb0d1f4942f79d07f /spec | |
parent | 35e8cb2c277cc0b691189a1e23900b1921b9acb3 (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-ee
Diffstat (limited to 'spec')
-rw-r--r-- | spec/tooling/danger/stable_branch_spec.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/spec/tooling/danger/stable_branch_spec.rb b/spec/tooling/danger/stable_branch_spec.rb index 08fd25b30e0..677e190b584 100644 --- a/spec/tooling/danger/stable_branch_spec.rb +++ b/spec/tooling/danger/stable_branch_spec.rb @@ -34,6 +34,14 @@ RSpec.describe Tooling::Danger::StableBranch, feature_category: :delivery do end end + shared_examples 'with a warning' do |failure_message| + it 'fails' do + expect(stable_branch).to receive(:warn).with(failure_message) + + subject + end + end + context 'when not applicable' do where(:stable_branch?, :security_mr?) do true | true @@ -103,17 +111,13 @@ RSpec.describe Tooling::Danger::StableBranch, feature_category: :delivery do context 'when not an applicable version' do let(:target_branch) { '14-9-stable-ee' } - it_behaves_like 'with a failure', described_class::VERSION_ERROR_MESSAGE + it_behaves_like 'with a warning', described_class::VERSION_WARNING_MESSAGE end context 'when the version API request fails' do let(:response_success) { false } - it 'adds a warning' do - expect(stable_branch).to receive(:warn).with(described_class::FAILED_VERSION_REQUEST_MESSAGE) - - subject - end + it_behaves_like 'with a warning', described_class::FAILED_VERSION_REQUEST_MESSAGE end context 'when more than one page of versions is needed' do |