summaryrefslogtreecommitdiff
path: root/spec/workers
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2017-08-25 12:10:53 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2017-08-25 12:10:53 +0000
commita653c8ead4d45ffcab5447a9e38f9742600c0d09 (patch)
treee48db5b9f0a2c1ebe9624aef0c66cfa5c18683f3 /spec/workers
parentfaf92651aa5e9c6bcb88acac8de27c878d7edf06 (diff)
parent676f77269daa8a8c697bc34666bf3b00d540099b (diff)
downloadgitlab-ce-a653c8ead4d45ffcab5447a9e38f9742600c0d09.tar.gz
Merge branch 'master' into 'backstage/gb/rename-ci-cd-processing-sidekiq-queues'
# Conflicts: # db/schema.rb
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/build_finished_worker_spec.rb2
-rw-r--r--spec/workers/namespaceless_project_destroy_worker_spec.rb14
2 files changed, 15 insertions, 1 deletions
diff --git a/spec/workers/build_finished_worker_spec.rb b/spec/workers/build_finished_worker_spec.rb
index 2868167c7d4..8cc3f37ebe8 100644
--- a/spec/workers/build_finished_worker_spec.rb
+++ b/spec/workers/build_finished_worker_spec.rb
@@ -3,7 +3,7 @@ require 'spec_helper'
describe BuildFinishedWorker do
describe '#perform' do
context 'when build exists' do
- let(:build) { create(:ci_build) }
+ let!(:build) { create(:ci_build) }
it 'calculates coverage and calls hooks' do
expect(BuildCoverageWorker)
diff --git a/spec/workers/namespaceless_project_destroy_worker_spec.rb b/spec/workers/namespaceless_project_destroy_worker_spec.rb
index 817e103fd9a..20cf580af8a 100644
--- a/spec/workers/namespaceless_project_destroy_worker_spec.rb
+++ b/spec/workers/namespaceless_project_destroy_worker_spec.rb
@@ -75,5 +75,19 @@ describe NamespacelessProjectDestroyWorker do
end
end
end
+
+ context 'project has non-existing namespace' do
+ let!(:project) do
+ project = build(:project, namespace_id: Namespace.maximum(:id).to_i.succ)
+ project.save(validate: false)
+ project
+ end
+
+ it 'deletes the project' do
+ subject.perform(project.id)
+
+ expect(Project.unscoped.all).not_to include(project)
+ end
+ end
end
end