diff options
Diffstat (limited to 'spec/features/projects/settings')
-rw-r--r-- | spec/features/projects/settings/visibility_settings_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/features/projects/settings/visibility_settings_spec.rb b/spec/features/projects/settings/visibility_settings_spec.rb index 0e757e647a0..a2b36874aea 100644 --- a/spec/features/projects/settings/visibility_settings_spec.rb +++ b/spec/features/projects/settings/visibility_settings_spec.rb @@ -64,6 +64,12 @@ describe 'Projects > Settings > Visibility settings', :js do it 'is visible' do expect(page).to have_selector('.js-emails-disabled', visible: true) end + + it 'accepts the changed state' do + find('.js-emails-disabled input[type="checkbox"]').click + + expect { save_permissions_group }.to change { updated_emails_disabled? }.to(true) + end end end @@ -89,4 +95,16 @@ describe 'Projects > Settings > Visibility settings', :js do end end end + + def save_permissions_group + page.within('.sharing-permissions') do + click_button 'Save changes' + wait_for_requests + end + end + + def updated_emails_disabled? + project.reload.clear_memoization(:emails_disabled) + project.emails_disabled? + end end |