diff options
author | Nick Thomas <nick@gitlab.com> | 2018-11-19 18:03:58 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-12-06 21:58:00 +0300 |
commit | 9395d198f9b9ec59858d2f316e58cda22ab80050 (patch) | |
tree | 0b494120c8d7d59316d590fada95adcbf0ac23f2 /spec/features/projects/settings | |
parent | 79b44c16ccf3827eba6b168aae6c395ac3f3df17 (diff) |
Use BFG object maps to clean projects
Diffstat (limited to 'spec/features/projects/settings')
-rw-r--r-- | spec/features/projects/settings/repository_settings_spec.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/features/projects/settings/repository_settings_spec.rb b/spec/features/projects/settings/repository_settings_spec.rb index b7a22316d26..418e22f8c35 100644 --- a/spec/features/projects/settings/repository_settings_spec.rb +++ b/spec/features/projects/settings/repository_settings_spec.rb @@ -196,5 +196,40 @@ describe 'Projects > Settings > Repository settings' do end end end + + context 'repository cleanup settings' do + let(:object_map_file) { Rails.root.join('spec', 'fixtures', 'bfg_object_map.txt') } + + context 'feature enabled' do + it 'uploads an object map file', :js do + stub_feature_flags(project_cleanup: true) + + visit project_settings_repository_path(project) + + expect(page).to have_content('Repository cleanup') + + page.within('#cleanup') do + attach_file('project[bfg_object_map]', object_map_file, visible: false) + + Sidekiq::Testing.fake! do + click_button 'Start cleanup' + end + end + + expect(page).to have_content('Repository cleanup has started') + expect(RepositoryCleanupWorker.jobs.count).to eq(1) + end + end + + context 'feature disabled' do + it 'does not show the settings' do + stub_feature_flags(project_cleanup: false) + + visit project_settings_repository_path(project) + + expect(page).not_to have_content('Repository cleanup') + end + end + end end end |