Commit d6a750fc authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '296895-fix-sub-groups-settings' into 'master'

Fix group path biding in view file

See merge request gitlab-org/gitlab!53717
parents 13e1a95e 99624821
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
- page_title _('Packages & Registries') - page_title _('Packages & Registries')
- @content_class = 'limit-container-width' unless fluid_layout - @content_class = 'limit-container-width' unless fluid_layout
%section#js-packages-and-registries-settings{ data: { default_expanded: expanded_by_default?.to_s, group_path: @group.path } } %section#js-packages-and-registries-settings{ data: { default_expanded: expanded_by_default?.to_s, group_path: @group.full_path } }
...@@ -7,9 +7,11 @@ RSpec.describe 'Group Packages & Registries settings' do ...@@ -7,9 +7,11 @@ RSpec.describe 'Group Packages & Registries settings' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:sub_group) { create(:group, parent: group) }
before do before do
group.add_owner(user) group.add_owner(user)
sub_group.add_owner(user)
sign_in(user) sign_in(user)
end end
...@@ -85,6 +87,18 @@ RSpec.describe 'Group Packages & Registries settings' do ...@@ -85,6 +87,18 @@ RSpec.describe 'Group Packages & Registries settings' do
expect(page).to have_content('is an invalid regexp') expect(page).to have_content('is an invalid regexp')
end end
context 'in a sub group' do
it 'works correctly', :js do
visit_sub_group_settings_page
expect(page).to have_content('Allow duplicates')
find('.gl-toggle').click
expect(page).to have_content('Do not allow duplicates')
end
end
end end
def find_settings_menu def find_settings_menu
...@@ -94,4 +108,8 @@ RSpec.describe 'Group Packages & Registries settings' do ...@@ -94,4 +108,8 @@ RSpec.describe 'Group Packages & Registries settings' do
def visit_settings_page def visit_settings_page
visit group_settings_packages_and_registries_path(group) visit group_settings_packages_and_registries_path(group)
end end
def visit_sub_group_settings_page
visit group_settings_packages_and_registries_path(sub_group)
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment