diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-19 15:15:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-19 15:15:59 +0300 |
commit | 2017bc90a671eac669f0114b6ef508e151409c4f (patch) | |
tree | 79bbbedede417d3ce13ae2e13dd1ad3bb069c975 /spec/tooling/danger | |
parent | 9450a63064cd1572f030628dbf155f5c047f28c7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tooling/danger')
-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 |