Skip to content
代码片段 群组 项目
提交 8a24f20a 编辑于 作者: Mehmet Emin INAC's avatar Mehmet Emin INAC
浏览文件

Merge branch 'mcelicalderong-follow-up-regression-spec' into 'master'

Add regression spec for security bot create service

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/132695



Merged-by: default avatarMehmet Emin INAC <minac@gitlab.com>
Approved-by: default avatarmo khan <mo@mokhan.ca>
Approved-by: default avatarMehmet Emin INAC <minac@gitlab.com>
Co-authored-by: default avatarAlan (Maciej) Paruszewski <mparuszewski@gitlab.com>
Co-authored-by: default avatarMario Celi <mcelicalderon@gitlab.com>
No related branches found
No related tags found
无相关合并请求
...@@ -129,7 +129,7 @@ def group_domain_limitations ...@@ -129,7 +129,7 @@ def group_domain_limitations
return unless group return unless group
if user if user
return if user.project_bot? return if user.project_bot? || user.security_policy_bot?
validate_users_email validate_users_email
validate_email_verified validate_email_verified
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Security::Orchestration::CreateBotService, feature_category: :security_policy_management do RSpec.describe Security::Orchestration::CreateBotService, feature_category: :security_policy_management do
let_it_be(:project) { create(:project) } let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, group: group) }
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let!(:security_orchestration_policy_configuration) do let!(:security_orchestration_policy_configuration) do
create(:security_orchestration_policy_configuration, project: project) create(:security_orchestration_policy_configuration, project: project)
...@@ -30,6 +31,18 @@ ...@@ -30,6 +31,18 @@
expect { execute_service }.to change { User.count }.by(1) expect { execute_service }.to change { User.count }.by(1)
expect(project.security_policy_bot).to be_present expect(project.security_policy_bot).to be_present
end end
context 'when group_allowed_email_domains feature is available' do
before do
stub_licensed_features(group_allowed_email_domains: true)
create(:allowed_email_domain, group: group, domain: 'noreply.gitlab.com')
end
it 'creates and assigns a bot user', :aggregate_failures do
expect { execute_service }.to change { User.count }.by(1)
expect(project.security_policy_bot).to be_present
end
end
end end
end end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册