diff options
author | Toon Claes <toon@gitlab.com> | 2017-05-09 22:16:52 +0200 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2017-05-10 15:01:27 +0200 |
commit | 37a79409d446955eeb443ea5397d5bf263601a2d (patch) | |
tree | c3e9ada5f5f50e11a48feb4e5edf2837963eafc3 /spec/workers | |
parent | 0ad80cab40097658b1eec5b87d440cfcd60d2755 (diff) | |
download | gitlab-ce-37a79409d446955eeb443ea5397d5bf263601a2d.tar.gz |
No user needed to cleanup namespaceless pending delete projects
Since this is a cleanup, ran by a post-deploy, there is no need to lookup the
admin to run the cleanup.
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/namespaceless_project_destroy_worker_spec.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/spec/workers/namespaceless_project_destroy_worker_spec.rb b/spec/workers/namespaceless_project_destroy_worker_spec.rb index ed78236ebc0..8533b7b85e9 100644 --- a/spec/workers/namespaceless_project_destroy_worker_spec.rb +++ b/spec/workers/namespaceless_project_destroy_worker_spec.rb @@ -14,15 +14,13 @@ describe NamespacelessProjectDestroyWorker do it 'does not do anything' do project = create(:empty_project) - subject.perform(project.id, project.owner.id, {}) + subject.perform(project.id) expect(Project.unscoped.all).to include(project) end end context 'project has no namespace' do - let(:admin) { create(:admin) } - let!(:project) do project = build(:empty_project, namespace_id: nil) project.save(validate: false) @@ -33,11 +31,11 @@ describe NamespacelessProjectDestroyWorker do it "truncates the project's team" do expect_any_instance_of(ProjectTeam).to receive(:truncate) - subject.perform(project.id, admin.id, {}) + subject.perform(project.id) end it 'deletes the project' do - subject.perform(project.id, admin.id, {}) + subject.perform(project.id) expect(Project.unscoped.all).not_to include(project) end @@ -45,13 +43,13 @@ describe NamespacelessProjectDestroyWorker do it 'does not call unlink_fork' do is_expected.not_to receive(:unlink_fork) - subject.perform(project.id, admin.id, {}) + subject.perform(project.id) end it 'does not do anything in Project#remove_pages method' do expect(Gitlab::PagesTransfer).not_to receive(:new) - subject.perform(project.id, admin.id, {}) + subject.perform(project.id) end end @@ -65,13 +63,13 @@ describe NamespacelessProjectDestroyWorker do it 'closes open merge requests' do merge_request = create(:merge_request, source_project: project, target_project: parent_project) - subject.perform(project.id, admin.id, {}) + subject.perform(project.id) expect(merge_request.reload).to be_closed end it 'destroys the link' do - subject.perform(project.id, admin.id, {}) + subject.perform(project.id) expect(parent_project.forked_project_links).to be_empty end |