Fix spec checking if VINE api is set up

The condition for checking the error now match a real scenario
This commit is contained in:
Gaetan Craig-Riou
2024-10-08 16:15:35 +11:00
parent df67b53971
commit 08308ba08e

View File

@@ -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