diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-04-13 14:52:54 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-04-13 14:52:54 +0300 |
commit | bcf7a7e76cc8aa4216f1df88be47172b9880ba24 (patch) | |
tree | 83730e36a5737c9bfaf843f75668d3e13d6faeee /spec/features | |
parent | ab98308db7d907e5fad53d2b1e3435960a1665cd (diff) | |
download | gitlab-ce-bcf7a7e76cc8aa4216f1df88be47172b9880ba24.tar.gz |
Don't reset application settings import sources
If form does not have import sources checkboxes we should not reset
import sources to empty. This fixes issue when import sources got reset
after user modifies unrelated settings section like GitLab pages
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/admin/admin_settings_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index 846b8040be6..50d0a7abe59 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -32,6 +32,29 @@ feature 'Admin updates settings' do expect(find('#application_setting_visibility_level_20')).not_to be_checked end + scenario 'Modify import sources' do + expect(Gitlab::CurrentSettings.import_sources).not_to be_empty + + page.within('.as-visibility-access') do + Gitlab::ImportSources.options.map do |name, _| + uncheck name + end + + click_button 'Save changes' + end + + expect(page).to have_content "Application settings saved successfully" + expect(Gitlab::CurrentSettings.import_sources).to be_empty + + page.within('.as-visibility-access') do + check "Repo by URL" + click_button 'Save changes' + end + + expect(page).to have_content "Application settings saved successfully" + expect(Gitlab::CurrentSettings.import_sources).to eq(['git']) + end + scenario 'Change Visibility and Access Controls' do page.within('.as-visibility-access') do uncheck 'Project export enabled' |