Commit fcdf3931 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix tests after group settings page redesign

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent ba6384e7
......@@ -3,7 +3,7 @@
- expanded = Rails.env.test?
%section.settings.as-general.no-animate#js-general-settings{ class: ('expanded' if expanded) }
%section.settings.gs-general.no-animate#js-general-settings{ class: ('expanded' if expanded) }
.settings-header
%h4
= _('General group settings')
......@@ -14,7 +14,7 @@
.settings-content
= render 'groups/settings/general'
%section.settings.as-permissions.no-animate#js-permissions-settings{ class: ('expanded' if expanded) }
%section.settings.gs-permissions.no-animate#js-permissions-settings{ class: ('expanded' if expanded) }
.settings-header
%h4
= _('Permissions')
......@@ -25,7 +25,7 @@
.settings-content
= render 'groups/settings/permissions'
%section.settings.as-advanced-settings.no-animate#js-advanced-settings{ class: ('expanded' if expanded) }
%section.settings.gs-advanced.no-animate#js-advanced-settings{ class: ('expanded' if expanded) }
.settings-header
%h4
= _('Advanced settings')
......
......@@ -9,7 +9,7 @@
= link_to 'Learn more', help_page_path('user/group/index', anchor: 'changing-a-groups-path'), target: '_blank'
.input-group.gl-field-error-anchor
.group-root-path.input-group-prepend.has-tooltip{ title: group_path, :'data-placement' => 'bottom' }
.group-root-path.input-group-prepend.has-tooltip{ title: group_path(@group), :'data-placement' => 'bottom' }
.input-group-text
%span>= root_url
- if parent
......
......@@ -83,7 +83,7 @@ feature 'Edit group settings' do
attach_file(:group_avatar, Rails.root.join('spec', 'fixtures', 'banana_sample.gif'))
expect { click_button 'Save group' }.to change { group.reload.avatar? }.to(true)
expect { save_group }.to change { group.reload.avatar? }.to(true)
end
it 'uploads new group avatar' do
......@@ -97,10 +97,19 @@ feature 'Edit group settings' do
expect(page).not_to have_link('Remove avatar')
end
end
end
def update_path(new_group_path)
def update_path(new_group_path)
visit edit_group_path(group)
page.within('.gs-advanced') do
fill_in 'group_path', with: new_group_path
click_button 'Change group path'
end
end
def save_group
page.within('.gs-general') do
click_button 'Save group'
end
end
end
......@@ -15,9 +15,8 @@ feature 'Group share with group lock' do
context 'when enabling the parent group share with group lock' do
scenario 'the subgroup share with group lock becomes enabled' do
visit edit_group_path(root_group)
check 'group_share_with_group_lock'
click_on 'Save group'
enable_group_lock
expect(subgroup.reload.share_with_group_lock?).to be_truthy
end
......@@ -26,16 +25,15 @@ feature 'Group share with group lock' do
context 'when disabling the parent group share with group lock (which was already enabled)' do
background do
visit edit_group_path(root_group)
check 'group_share_with_group_lock'
click_on 'Save group'
enable_group_lock
end
context 'and the subgroup share with group lock is enabled' do
scenario 'the subgroup share with group lock does not change' do
visit edit_group_path(root_group)
uncheck 'group_share_with_group_lock'
click_on 'Save group'
disable_group_lock
expect(subgroup.reload.share_with_group_lock?).to be_truthy
end
......@@ -44,19 +42,32 @@ feature 'Group share with group lock' do
context 'but the subgroup share with group lock is disabled' do
background do
visit edit_group_path(subgroup)
uncheck 'group_share_with_group_lock'
click_on 'Save group'
disable_group_lock
end
scenario 'the subgroup share with group lock does not change' do
visit edit_group_path(root_group)
uncheck 'group_share_with_group_lock'
click_on 'Save group'
disable_group_lock
expect(subgroup.reload.share_with_group_lock?).to be_falsey
end
end
end
end
def enable_group_lock
page.within('.gs-permissions') do
check 'group_share_with_group_lock'
click_on 'Save group'
end
end
def disable_group_lock
page.within('.gs-permissions') do
uncheck 'group_share_with_group_lock'
click_on 'Save group'
end
end
end
......@@ -141,7 +141,7 @@ feature 'Group' do
end
it 'saves new settings' do
page.within('.as-general') do
page.within('.gs-general') do
fill_in 'group_name', with: new_name
click_button 'Save group'
end
......
......@@ -14,7 +14,9 @@ feature 'User uploads avatar to group' do
visible: false
)
page.within('.gs-general') do
click_button 'Save group'
end
visit group_path(group)
......
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