diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-03 21:33:57 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-03 21:33:57 +0000 |
commit | b97109263112a40beefc758c360f3aa8c8848719 (patch) | |
tree | 67b88b8e974ccfef28ee991bf5803b998a03ccba /spec | |
parent | 739f6fecbf4faeac17024be1def340bf9636c235 (diff) | |
download | gitlab-ce-b97109263112a40beefc758c360f3aa8c8848719.tar.gz |
Add latest changes from gitlab-org/gitlab@12-6-stable-ee
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/danger/changelog_spec.rb | 1 | ||||
-rw-r--r-- | spec/lib/gitlab/danger/helper_spec.rb | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/spec/lib/gitlab/danger/changelog_spec.rb b/spec/lib/gitlab/danger/changelog_spec.rb index 888094eaf6e..689957993ec 100644 --- a/spec/lib/gitlab/danger/changelog_spec.rb +++ b/spec/lib/gitlab/danger/changelog_spec.rb @@ -34,6 +34,7 @@ describe Gitlab::Danger::Changelog do { docs: nil, none: nil } ].each do |categories| let(:changes_by_category) { categories } + it "is falsy when categories don't require a changelog" do is_expected.to be_falsy end diff --git a/spec/lib/gitlab/danger/helper_spec.rb b/spec/lib/gitlab/danger/helper_spec.rb index d7e67444fca..edcd020a10f 100644 --- a/spec/lib/gitlab/danger/helper_spec.rb +++ b/spec/lib/gitlab/danger/helper_spec.rb @@ -312,4 +312,26 @@ describe Gitlab::Danger::Helper do it { is_expected.to match_array(['database', 'database::review pending']) } end end + + describe '#security_mr?' do + it 'returns false when `gitlab_helper` is unavailable' do + expect(helper).to receive(:gitlab_helper).and_return(nil) + + expect(helper).not_to be_security_mr + end + + it 'returns false when on a normal merge request' do + expect(fake_gitlab).to receive(:mr_json) + .and_return('web_url' => 'https://gitlab.com/gitlab-org/gitlab/merge_requests/1') + + expect(helper).not_to be_security_mr + end + + it 'returns true when on a security merge request' do + expect(fake_gitlab).to receive(:mr_json) + .and_return('web_url' => 'https://gitlab.com/gitlab-org/security/gitlab/merge_requests/1') + + expect(helper).to be_security_mr + end + end end |