From 08308ba08e2638873b6a6910f1e30700f6b2ca31 Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Tue, 8 Oct 2024 16:15:35 +1100 Subject: [PATCH] Fix spec checking if VINE api is set up The condition for checking the error now match a real scenario --- spec/requests/admin/connected_apps_controller_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/requests/admin/connected_apps_controller_spec.rb b/spec/requests/admin/connected_apps_controller_spec.rb index f1330ae7e2..05b7eefa0c 100644 --- a/spec/requests/admin/connected_apps_controller_spec.rb +++ b/spec/requests/admin/connected_apps_controller_spec.rb @@ -113,8 +113,9 @@ RSpec.describe "Admin ConnectedApp" do context "when VINE API is not set up properly" do before do - # VineApiService will raise a KeyError if VINE_API_URL is not set - allow(VineApiService).to receive(:new).and_raise(KeyError) + allow(ENV).to receive(:fetch).and_call_original + allow(ENV).to receive(:fetch).with("VINE_API_URL").and_raise(KeyError) + allow(VineApiService).to receive(:new).and_call_original end it "redirects to enterprise edit page, with an error" do