Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-04 03:07:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-04 03:07:49 +0300
commit9671f01956bb09cd2a5970c1e4c8e8aa6797ef18 (patch)
treecefd63c14fdb1248fa9424932639e40bafdf9275 /spec/lib/gitlab/danger
parent5e7ed643dca39625fcc7b0d0e9e15550f5a9f1f8 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/danger')
-rw-r--r--spec/lib/gitlab/danger/changelog_spec.rb1
-rw-r--r--spec/lib/gitlab/danger/helper_spec.rb22
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