Fix tests and rename request
variable in specs to perform_request
Explanation: Using the variable name `request` might interfere with methods in Rails core system prevent successful test execution. See this issue: https://github.com/turbolinks/turbolinks-rails/issues/38
This commit is contained in:
@ -9,14 +9,14 @@ describe ExecutionEnvironmentsController do
|
||||
before(:each) { expect(DockerClient).to receive(:image_tags).at_least(:once).and_return([]) }
|
||||
|
||||
context 'with a valid execution environment' do
|
||||
let(:request) { proc { post :create, params: { execution_environment: FactoryBot.build(:ruby).attributes } } }
|
||||
before(:each) { request.call }
|
||||
let(:perform_request) { proc { post :create, params: { execution_environment: FactoryBot.build(:ruby).attributes } } }
|
||||
before(:each) { perform_request.call }
|
||||
|
||||
expect_assigns(docker_images: Array)
|
||||
expect_assigns(execution_environment: ExecutionEnvironment)
|
||||
|
||||
it 'creates the execution environment' do
|
||||
expect { request.call }.to change(ExecutionEnvironment, :count).by(1)
|
||||
expect { perform_request.call }.to change(ExecutionEnvironment, :count).by(1)
|
||||
end
|
||||
|
||||
expect_redirect(ExecutionEnvironment.last)
|
||||
|
Reference in New Issue
Block a user