From a64b8724bd727560f2d8a268f738dc784840499f Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 26 Feb 2015 16:19:36 +0000 Subject: [PATCH] include the build parameter in the compile unit tests --- .../coffee/Compile/ClsiManagerTests.coffee | 4 ++++ .../coffee/Compile/CompileControllerTests.coffee | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/services/web/test/UnitTests/coffee/Compile/ClsiManagerTests.coffee b/services/web/test/UnitTests/coffee/Compile/ClsiManagerTests.coffee index 431aabec97..8eda10fa56 100644 --- a/services/web/test/UnitTests/coffee/Compile/ClsiManagerTests.coffee +++ b/services/web/test/UnitTests/coffee/Compile/ClsiManagerTests.coffee @@ -36,9 +36,11 @@ describe "ClsiManager", -> outputFiles: [{ url: "#{@settings.apis.clsi.url}/project/#{@project_id}/output/output.pdf" type: "pdf" + build: 1234 },{ url: "#{@settings.apis.clsi.url}/project/#{@project_id}/output/output.log" type: "log" + build: 1234 }] }) @ClsiManager.sendRequest @project_id, {compileGroup:"standard"}, @callback @@ -57,9 +59,11 @@ describe "ClsiManager", -> outputFiles = [{ path: "output.pdf" type: "pdf" + build: 1234 },{ path: "output.log" type: "log" + build: 1234 }] @callback.calledWith(null, @status, outputFiles).should.equal true diff --git a/services/web/test/UnitTests/coffee/Compile/CompileControllerTests.coffee b/services/web/test/UnitTests/coffee/Compile/CompileControllerTests.coffee index fae9dec23f..e2115addbb 100644 --- a/services/web/test/UnitTests/coffee/Compile/CompileControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/Compile/CompileControllerTests.coffee @@ -231,6 +231,21 @@ describe "CompileController", -> ) .should.equal true + describe "user with build parameter via query string", -> + beforeEach -> + @CompileManager.getProjectCompileLimits = sinon.stub().callsArgWith(1, null, {compileGroup: "standard"}) + @req.query = {build: 1234} + @CompileController.proxyToClsi(@project_id, @url = "/test", @req, @res, @next) + + it "should proxy to the standard url with the build parameter", ()-> + @request + .calledWith( + method: @req.method + qs: {build: 1234} + url: "#{@settings.apis.clsi.url}#{@url}", + timeout: 60 * 1000 + ) + .should.equal true describe "new pdf viewer", -> beforeEach ->