From 75b2c9bf6f5529bf198fef92903ad27836487ca6 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sat, 6 Oct 2018 18:05:14 +0000 Subject: [PATCH] Fix invalid parent path on group settings page --- app/views/groups/settings/_advanced.html.haml | 4 ++-- .../52242-ui-ux-bug-in-change-group-path.yml | 5 +++++ spec/features/groups/group_settings_spec.rb | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/52242-ui-ux-bug-in-change-group-path.yml diff --git a/app/views/groups/settings/_advanced.html.haml b/app/views/groups/settings/_advanced.html.haml index b7c673db705..3814d45929d 100644 --- a/app/views/groups/settings/_advanced.html.haml +++ b/app/views/groups/settings/_advanced.html.haml @@ -12,8 +12,8 @@ .group-root-path.input-group-prepend.has-tooltip{ title: group_path(@group), :'data-placement' => 'bottom' } .input-group-text %span>= root_url - - if parent - %strong= parent.full_path + '/' + - if @group.parent + %strong= @group.parent.full_path + '/' = f.hidden_field :parent_id = f.text_field :path, placeholder: 'open-source', class: 'form-control', autofocus: local_assigns[:autofocus] || false, required: true, diff --git a/changelogs/unreleased/52242-ui-ux-bug-in-change-group-path.yml b/changelogs/unreleased/52242-ui-ux-bug-in-change-group-path.yml new file mode 100644 index 00000000000..3fea6f33451 --- /dev/null +++ b/changelogs/unreleased/52242-ui-ux-bug-in-change-group-path.yml @@ -0,0 +1,5 @@ +--- +title: Fix incorrect parent path on group settings page +merge_request: 22142 +author: +type: fixed diff --git a/spec/features/groups/group_settings_spec.rb b/spec/features/groups/group_settings_spec.rb index 59254ecc982..08fd9f8af2a 100644 --- a/spec/features/groups/group_settings_spec.rb +++ b/spec/features/groups/group_settings_spec.rb @@ -98,6 +98,22 @@ describe 'Edit group settings' do end end + describe 'edit group path' do + it 'has a root URL label for top-level group' do + visit edit_group_path(group) + + expect(find(:css, '.group-root-path').text).to eq(root_url) + end + + it 'has a parent group URL label for a subgroup group', :postgresql do + subgroup = create(:group, parent: group) + + visit edit_group_path(subgroup) + + expect(find(:css, '.group-root-path').text).to eq(group_url(subgroup.parent) + '/') + end + end + def update_path(new_group_path) visit edit_group_path(group)