Skip to content
代码片段 群组 项目
未验证 提交 85dd6f08 编辑于 作者: Grzegorz Bizon's avatar Grzegorz Bizon 提交者: GitLab
浏览文件

Merge branch '362083-error-loading-mardown' into 'master'

No related branches found
No related tags found
加载中
......@@ -256,8 +256,10 @@
end
end
resources :groups, only: [:index, :new, :create] do
post :preview_markdown
resources(:groups, only: [:index, :new, :create]) do
# The constraints ensure that the `group_id` parameter in the URL allows for multiple levels
# of subgroups, permitting both regular and encoded slashes (%2F).
post :preview_markdown, constraints: { group_id: %r{#{Gitlab::PathRegex.full_namespace_route_regex.source}(%2F#{Gitlab::PathRegex.full_namespace_route_regex.source})*} }
end
draw :group
......
......@@ -180,6 +180,31 @@
let(:epic) { create(:epic, group: group, description: markdown) }
it_behaves_like 'updates epic'
context 'when group name has dot(.)' do
let_it_be(:group) { create(:group, :public, name: 'test.group') }
let(:epic) { create(:epic, group: group, description: markdown) }
it_behaves_like 'updates epic'
context 'when sub-group has dot(.)' do
let_it_be(:parent) { create(:group, :public) }
let_it_be(:group) { create(:group, :public, parent: parent, name: 'test.subgroup') }
let(:epic) { create(:epic, group: group, description: markdown) }
it_behaves_like 'updates epic'
# As we have used recurring regex in routes to have 1+ level sub groups
# tested 2 level subgroup here
context 'when 2 level subgroup name has dot(.)' do
let_it_be(:parent1) { create(:group, :public, parent: parent) }
let_it_be(:group) { create(:group, :public, parent: parent1, name: 'test.subgroup2') }
let(:epic) { create(:epic, group: group, description: markdown) }
it_behaves_like 'updates epic'
end
end
end
end
context 'when user with developer access displays the epic from a subgroup' do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册