diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-20 15:05:15 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-20 15:05:15 +0000 |
commit | a6b4506e1909ebc6234cdcd344a280959e4005b8 (patch) | |
tree | fcab90055c34bb3d7485be70664573f882f17255 /spec | |
parent | 32e805816a86a795130fd115e888f196d14d0b8c (diff) | |
download | gitlab-ce-a6b4506e1909ebc6234cdcd344a280959e4005b8.tar.gz |
Add latest changes from gitlab-org/gitlab@15-10-stable-ee
Diffstat (limited to 'spec')
-rw-r--r-- | spec/tooling/danger/stable_branch_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/tooling/danger/stable_branch_spec.rb b/spec/tooling/danger/stable_branch_spec.rb index b0a8ab3c132..fc644413a5a 100644 --- a/spec/tooling/danger/stable_branch_spec.rb +++ b/spec/tooling/danger/stable_branch_spec.rb @@ -351,4 +351,26 @@ RSpec.describe Tooling::Danger::StableBranch, feature_category: :delivery do it { is_expected.to eq(result) } end end + + describe '#valid_stable_branch?' do + it "returns false when on the default branch" do + allow(fake_helper).to receive(:mr_target_branch).and_return('main') + + expect(stable_branch.valid_stable_branch?).to be(false) + end + + it "returns true when on a stable branch" do + allow(fake_helper).to receive(:mr_target_branch).and_return('15-1-stable-ee') + allow(fake_helper).to receive(:security_mr?).and_return(false) + + expect(stable_branch.valid_stable_branch?).to be(true) + end + + it "returns false when on a stable branch on a security MR" do + allow(fake_helper).to receive(:mr_target_branch).and_return('15-1-stable-ee') + allow(fake_helper).to receive(:security_mr?).and_return(true) + + expect(stable_branch.valid_stable_branch?).to be(false) + end + end end |