added the ability to prohibit network access for code submissions executed using Docker
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
require 'rails_helper'
|
||||
|
||||
describe ExecutionEnvironment do
|
||||
let(:execution_environment) { described_class.create }
|
||||
let(:execution_environment) { described_class.create.tap { |execution_environment| execution_environment.update(network_enabled: nil) } }
|
||||
|
||||
it 'validates that the Docker image works', docker: true do
|
||||
expect(execution_environment).to receive(:validate_docker_image?).and_return(true)
|
||||
@ -32,6 +32,10 @@ describe ExecutionEnvironment do
|
||||
expect(execution_environment.errors[:name]).to be_present
|
||||
end
|
||||
|
||||
it 'validates the presence of the network enabled flag' do
|
||||
expect(execution_environment.errors[:network_enabled]).to be_present
|
||||
end
|
||||
|
||||
it 'validates the numericality of the permitted run time' do
|
||||
execution_environment.update(permitted_execution_time: Math::PI)
|
||||
expect(execution_environment.errors[:permitted_execution_time]).to be_present
|
||||
|
Reference in New Issue
Block a user