Refactor sync_environment methods
* Add delete_environment method * Change return value to allow raising an exception
This commit is contained in:
@ -46,7 +46,10 @@ describe ExecutionEnvironmentsController do
|
||||
end
|
||||
|
||||
describe 'DELETE #destroy' do
|
||||
before { delete :destroy, params: {id: execution_environment.id} }
|
||||
before do
|
||||
allow(Runner.strategy_class).to receive(:remove_environment).and_return(true)
|
||||
delete :destroy, params: {id: execution_environment.id}
|
||||
end
|
||||
|
||||
expect_assigns(execution_environment: :execution_environment)
|
||||
|
||||
@ -55,6 +58,10 @@ describe ExecutionEnvironmentsController do
|
||||
expect { delete :destroy, params: {id: execution_environment.id} }.to change(ExecutionEnvironment, :count).by(-1)
|
||||
end
|
||||
|
||||
it 'removes the execution environment from the runner management' do
|
||||
expect(Runner.strategy_class).to have_received(:remove_environment)
|
||||
end
|
||||
|
||||
expect_redirect(:execution_environments)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user