From ab0f258c033c26fe49e2fc35673973a430eef433 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 19 Jun 2018 14:22:34 +0100 Subject: [PATCH] don't make request to google cloud clsi if there is no url --- .../test/unit/coffee/Compile/ClsiManagerTests.coffee | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/services/web/test/unit/coffee/Compile/ClsiManagerTests.coffee b/services/web/test/unit/coffee/Compile/ClsiManagerTests.coffee index 850c03465e..c407073366 100644 --- a/services/web/test/unit/coffee/Compile/ClsiManagerTests.coffee +++ b/services/web/test/unit/coffee/Compile/ClsiManagerTests.coffee @@ -493,16 +493,22 @@ describe "ClsiManager", -> url : "https://compiles.googlecloud.test" @response = {there:"something"} @request.callsArgWith(1, null, @response) - - it "should change the domain on the url", (done)-> @opts = url: @ClsiManager._getCompilerUrl(null, @project_id) - + + it "should change the domain on the url", (done)-> @ClsiManager._makeGoogleCloudRequest @project_id, @opts, => args = @request.args[0] args[0].url.should.equal "https://compiles.googlecloud.test/project/#{@project_id}" done() + it "should not make a request if there is not clsigc url", (done)-> + @settings.apis.clsigc = undefined + @ClsiManager._makeGoogleCloudRequest @project_id, @opts, (err)=> + expect(err).to.equal undefined + @request.callCount.should.equal 0 + done() +