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/controllers | |
parent | 79b44c16ccf3827eba6b168aae6c395ac3f3df17 (diff) |
Use BFG object maps to clean projects
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/settings/repository_controller_spec.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/controllers/projects/settings/repository_controller_spec.rb b/spec/controllers/projects/settings/repository_controller_spec.rb index 9cee40b7553..69ec971bb75 100644 --- a/spec/controllers/projects/settings/repository_controller_spec.rb +++ b/spec/controllers/projects/settings/repository_controller_spec.rb @@ -17,4 +17,35 @@ describe Projects::Settings::RepositoryController do expect(response).to render_template(:show) end end + + describe 'PUT cleanup' do + def do_put! + object_map = fixture_file_upload('spec/fixtures/bfg_object_map.txt') + + Sidekiq::Testing.fake! do + put :cleanup, namespace_id: project.namespace, project_id: project, project: { object_map: object_map } + end + end + + context 'feature enabled' do + it 'enqueues a RepositoryCleanupWorker' do + stub_feature_flags(project_cleanup: true) + + do_put! + + expect(response).to redirect_to project_settings_repository_path(project) + expect(RepositoryCleanupWorker.jobs.count).to eq(1) + end + end + + context 'feature disabled' do + it 'shows a 404 error' do + stub_feature_flags(project_cleanup: false) + + do_put! + + expect(response).to have_gitlab_http_status(404) + end + end + end end |