Revert "priority compiles are proxyed to the priority servers"
This reverts commit 5375af085a1fc20def19a858e3f63c52f3bec9b0.
This commit is contained in:
@@ -20,8 +20,6 @@ describe "CompileController", ->
|
||||
apis:
|
||||
clsi:
|
||||
url: "clsi.example.com"
|
||||
clsi_priority:
|
||||
url: "clsi-priority.example.com"
|
||||
"request": @request = sinon.stub()
|
||||
"../../models/Project": Project: @Project = {}
|
||||
"logger-sharelatex": @logger = { log: sinon.stub(), error: sinon.stub() }
|
||||
@@ -147,50 +145,24 @@ describe "CompileController", ->
|
||||
statusCode: 204
|
||||
headers: { "mock": "header" }
|
||||
@req.method = "mock-method"
|
||||
@AuthenticationController.getLoggedInUserId = sinon.stub().callsArgWith(1, null, @user_id = "mock-user-id")
|
||||
|
||||
|
||||
describe "user with standard priority", ->
|
||||
|
||||
beforeEach ->
|
||||
@UserGetter.getUser.callsArgWith(2, null, @user)
|
||||
@CompileController.proxyToClsi(@url = "/test", @req, @res, @next)
|
||||
|
||||
it "should open a request to the CLSI", ->
|
||||
@request
|
||||
.calledWith(
|
||||
method: @req.method
|
||||
url: "#{@settings.apis.clsi.url}#{@url}",
|
||||
timeout: 60 * 1000
|
||||
)
|
||||
.should.equal true
|
||||
|
||||
it "should pass the request on to the client", ->
|
||||
@proxy.pipe
|
||||
.calledWith(@res)
|
||||
.should.equal true
|
||||
|
||||
it "should bind an error handle to the request proxy", ->
|
||||
@proxy.on.calledWith("error").should.equal true
|
||||
|
||||
describe "user with priority compile", ->
|
||||
|
||||
beforeEach ->
|
||||
@user.features.compileGroup = "priority"
|
||||
@UserGetter.getUser.callsArgWith(2, null, @user)
|
||||
@CompileController.proxyToClsi(@url = "/test", @req, @res, @next)
|
||||
|
||||
it "should proxy to the priorty url if the user has the feature", ()->
|
||||
@request
|
||||
.calledWith(
|
||||
method: @req.method
|
||||
url: "#{@settings.apis.clsi_priority.url}#{@url}",
|
||||
timeout: 60 * 1000
|
||||
)
|
||||
.should.equal true
|
||||
@CompileController.proxyToClsi(@url = "/test", @req, @res, @next)
|
||||
|
||||
it "should open a request to the CLSI", ->
|
||||
@request
|
||||
.calledWith(
|
||||
method: @req.method
|
||||
url: "#{@settings.apis.clsi.url}#{@url}",
|
||||
timeout: 60 * 1000
|
||||
)
|
||||
.should.equal true
|
||||
|
||||
it "should pass the request on to the client", ->
|
||||
@proxy.pipe
|
||||
.calledWith(@res)
|
||||
.should.equal true
|
||||
|
||||
it "should bind an error handle to the request proxy", ->
|
||||
@proxy.on.calledWith("error").should.equal true
|
||||
|
||||
describe "deleteAuxFiles", ->
|
||||
beforeEach ->
|
||||
@@ -229,8 +201,3 @@ describe "CompileController", ->
|
||||
@CompileController.compileAndDownloadPdf @req, @res
|
||||
@CompileController.proxyToClsi.calledWith("/project/#{@project_id}/output/output.pdf", @req, @res).should.equal true
|
||||
done()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user