Skip to content
代码片段 群组 项目
未验证 提交 34fda118 编辑于 作者: Piotr Skorupa's avatar Piotr Skorupa 提交者: GitLab
浏览文件

Merge branch 'ngala/fix-pages-redirect-worker' into 'master'

Fix: Removing all domains does not reset primary domain

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



Merged-by: default avatarPiotr Skorupa <pskorupa@gitlab.com>
Approved-by: default avatarAlisa Frunza <afrunza@gitlab.com>
Approved-by: default avatarPiotr Skorupa <pskorupa@gitlab.com>
Reviewed-by: default avatarAlisa Frunza <afrunza@gitlab.com>
Co-authored-by: default avatarngala <ngala@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -13,7 +13,9 @@ def handle_event(event)
return unless project_settings
return unless project_settings.pages_primary_domain
return unless event.data['domain'] == project_settings.pages_primary_domain
primary_domain = URI.parse(project_settings.pages_primary_domain).host
return unless event.data['domain'] == primary_domain
project_settings.update!(pages_primary_domain: nil)
end
......
......@@ -4,12 +4,13 @@
RSpec.describe Pages::ResetPagesDefaultDomainRedirectWorker, feature_category: :pages do
let_it_be_with_reload(:project) { create(:project) }
let_it_be(:primary_domain_url_with_scheme) { 'https://primary.domain.com' }
let_it_be(:primary_domain_url) { 'primary.domain.com' }
let_it_be(:non_primary_domain_url) { 'non-primary.domain.com' }
let_it_be(:primary_domain) { create(:pages_domain, project: project, domain: primary_domain_url) }
let_it_be(:non_primary_domain) { create(:pages_domain, project: project, domain: non_primary_domain_url) }
let_it_be(:project_setting) do
create(:project_setting, project: project, pages_primary_domain: primary_domain_url)
create(:project_setting, project: project, pages_primary_domain: primary_domain_url_with_scheme)
end
let(:event) do
......@@ -33,7 +34,7 @@
expect { use_event }
.to change { project.reload.project_setting.pages_primary_domain }
.from(primary_domain_url).to(nil)
.from(primary_domain_url_with_scheme).to(nil)
end
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册