diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-15 16:48:42 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-15 16:48:42 +0200 |
commit | fefc3e9e4f476078e0402dd2585c664beda4b98f (patch) | |
tree | b0bd8488bed89a92706d8739b7089674aac1e92a /spec/services | |
parent | 78d5828fb2142c612ceba687debfb97bac2f671e (diff) | |
download | gitlab-ce-fair-usage-of-shared-runners.tar.gz |
Make sure that we test RegisterBuildService behavior for deleted projectsfair-usage-of-shared-runners
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/ci/register_build_service_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/services/ci/register_build_service_spec.rb b/spec/services/ci/register_build_service_spec.rb index fa4c2fddeb8..f28f2f1438d 100644 --- a/spec/services/ci/register_build_service_spec.rb +++ b/spec/services/ci/register_build_service_spec.rb @@ -45,6 +45,28 @@ module Ci end end + context 'deleted projects' do + before do + project.update(pending_delete: true) + end + + context 'for shared runners' do + before do + project.update(shared_runners_enabled: true) + end + + it 'does not pick a build' do + expect(service.execute(shared_runner)).to be_nil + end + end + + context 'for specific runner' do + it 'does not pick a build' do + expect(service.execute(specific_runner)).to be_nil + end + end + end + context 'allow shared runners' do before do project.update(shared_runners_enabled: true) |