Make sure that we test RegisterBuildService behavior for deleted projects

This commit is contained in:
Kamil Trzcinski 2016-06-15 16:48:42 +02:00
parent 78d5828fb2
commit fefc3e9e4f
1 changed files with 22 additions and 0 deletions

View File

@ -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)