mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-01 23:59:49 -05:00
35 lines
821 B
CoffeeScript
35 lines
821 B
CoffeeScript
|
Client = require "./helpers/Client"
|
||
|
request = require "request"
|
||
|
require("chai").should()
|
||
|
|
||
|
describe "Deleting Old Files", ->
|
||
|
before ->
|
||
|
@request =
|
||
|
resources: [
|
||
|
path: "main.tex"
|
||
|
content: '''
|
||
|
\\documentclass{article}
|
||
|
\\begin{document}
|
||
|
Hello world
|
||
|
\\end{document}
|
||
|
'''
|
||
|
]
|
||
|
|
||
|
describe "on first run", ->
|
||
|
before (done) ->
|
||
|
@project_id = Client.randomId()
|
||
|
Client.compile @project_id, @request, (@error, @res, @body) => done()
|
||
|
|
||
|
it "should return a success status", ->
|
||
|
@body.compile.status.should.equal "success"
|
||
|
|
||
|
describe "after file has been deleted", ->
|
||
|
before (done) ->
|
||
|
@request.resources = []
|
||
|
Client.compile @project_id, @request, (@error, @res, @body) =>
|
||
|
done()
|
||
|
|
||
|
it "should return a failure status", ->
|
||
|
@body.compile.status.should.equal "failure"
|
||
|
|