| ... | ... | @@ -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 |