Skip verification of Docker image if pool size is empty

This commit is contained in:
Sebastian Serth
2021-11-09 17:37:11 +01:00
parent b179dadce6
commit fb92d382ac
3 changed files with 10 additions and 3 deletions

View File

@ -138,8 +138,14 @@ describe ExecutionEnvironment do
expect(execution_environment.send(:validate_docker_image?)).to be false
end
it 'is false when the pool size is empty' do
expect(execution_environment.pool_size).to be 0
expect(execution_environment.send(:validate_docker_image?)).to be false
end
it 'is true otherwise' do
execution_environment.docker_image = FactoryBot.attributes_for(:ruby)[:docker_image]
execution_environment.pool_size = 1
allow(Rails.env).to receive(:test?).and_return(false)
expect(execution_environment.send(:validate_docker_image?)).to be true
end