From e688913fcb076d97290188c1ad66b70e4684db1d Mon Sep 17 00:00:00 2001 From: James Allen Date: Thu, 13 Feb 2014 11:11:53 +0000 Subject: [PATCH] Fix unit tests --- .gitignore | 1 + test/smoke/js/SmokeTests.js | 67 --------------------- test/unit/coffee/CompileManagerTests.coffee | 2 +- 3 files changed, 2 insertions(+), 68 deletions(-) delete mode 100644 test/smoke/js/SmokeTests.js diff --git a/.gitignore b/.gitignore index a039a12..0a58336 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules app/js test/unit/js +test/smoke/js test/acceptance/js test/acceptance/fixtures/tmp compiles diff --git a/test/smoke/js/SmokeTests.js b/test/smoke/js/SmokeTests.js deleted file mode 100644 index 13b2fa4..0000000 --- a/test/smoke/js/SmokeTests.js +++ /dev/null @@ -1,67 +0,0 @@ -(function() { - var Settings, buildUrl, chai, expect, request; - - chai = require("chai"); - - chai.should(); - - expect = chai.expect; - - request = require("request"); - - Settings = require("settings-sharelatex"); - - buildUrl = function(path) { - return "http://" + Settings.internal.clsi.host + ":" + Settings.internal.clsi.port + "/" + path; - }; - - describe("Running a compile", function() { - before(function(done) { - var _this = this; - return request.post({ - url: buildUrl("project/smoketest/compile"), - json: { - compile: { - resources: [ - { - path: "main.tex", - content: "\\documentclass{article}\n\\begin{document}\nHello world\n\\end{document}" - } - ] - } - } - }, function(error, response, body) { - _this.error = error; - _this.response = response; - _this.body = body; - if (_this.error != null) { - throw _this.error; - } - return done(); - }); - }); - it("should return the pdf", function() { - var file, _i, _len, _ref; - _ref = this.body.compile.outputFiles; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - if (file.type === "pdf") { - return; - } - } - throw new Error("no pdf returned"); - }); - return it("should return the log", function() { - var file, _i, _len, _ref; - _ref = this.body.compile.outputFiles; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - if (file.type === "log") { - return; - } - } - throw new Error("no log returned"); - }); - }); - -}).call(this); diff --git a/test/unit/coffee/CompileManagerTests.coffee b/test/unit/coffee/CompileManagerTests.coffee index 098e296..204da11 100644 --- a/test/unit/coffee/CompileManagerTests.coffee +++ b/test/unit/coffee/CompileManagerTests.coffee @@ -66,7 +66,7 @@ describe "CompileManager", -> @CompileManager.clearProject @project_id, @callback it "should remove the project directory", -> - @rimraf.calledWith("#{@Settings.compileDir}/#{@project_id}") + @rimraf.calledWith("#{@Settings.path.compilesDir}/#{@project_id}") .should.equal true it "should call the callback", ->