Commit 9ed1c2b5 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'bvl-port-of-dylans-spec-fix' into 'master'

Remove Sidekiq::Testing in RepositoryController spec

See merge request gitlab-org/gitlab-ce!23653
parents 96e4e15b f31429c1
...@@ -19,13 +19,15 @@ describe Projects::Settings::RepositoryController do ...@@ -19,13 +19,15 @@ describe Projects::Settings::RepositoryController do
end end
describe 'PUT cleanup' do describe 'PUT cleanup' do
before do
allow(RepositoryCleanupWorker).to receive(:perform_async)
end
def do_put! def do_put!
object_map = fixture_file_upload('spec/fixtures/bfg_object_map.txt') 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 } put :cleanup, namespace_id: project.namespace, project_id: project, project: { object_map: object_map }
end end
end
context 'feature enabled' do context 'feature enabled' do
it 'enqueues a RepositoryCleanupWorker' do it 'enqueues a RepositoryCleanupWorker' do
...@@ -34,7 +36,7 @@ describe Projects::Settings::RepositoryController do ...@@ -34,7 +36,7 @@ describe Projects::Settings::RepositoryController do
do_put! do_put!
expect(response).to redirect_to project_settings_repository_path(project) expect(response).to redirect_to project_settings_repository_path(project)
expect(RepositoryCleanupWorker.jobs.count).to eq(1) expect(RepositoryCleanupWorker).to have_received(:perform_async).once
end end
end end
......
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