From 1b21e2cd265934bf70de89c489032165a4b669e4 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Thu, 22 Jun 2023 19:45:41 +0200 Subject: [PATCH] Explicitly disable the runner management for the dashboard test --- spec/controllers/admin/dashboard_controller_spec.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spec/controllers/admin/dashboard_controller_spec.rb b/spec/controllers/admin/dashboard_controller_spec.rb index 5a0003fa..79bbbfde 100644 --- a/spec/controllers/admin/dashboard_controller_spec.rb +++ b/spec/controllers/admin/dashboard_controller_spec.rb @@ -5,7 +5,15 @@ require 'rails_helper' describe Admin::DashboardController do render_views - before { allow(controller).to receive(:current_user).and_return(build(:admin)) } + let(:codeocean_config) { instance_double(CodeOcean::Config) } + let(:runner_management_config) { {runner_management: {enabled: false}} } + + before do + allow(controller).to receive(:current_user).and_return(build(:admin)) + + allow(CodeOcean::Config).to receive(:new).with(:code_ocean).and_return(codeocean_config) + allow(codeocean_config).to receive(:read).and_return(runner_management_config) + end describe 'GET #show' do describe 'with format HTML' do