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