mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
improved docstore acceptence tests to deal with changing docs on get all docs
This commit is contained in:
parent
7b0b72494f
commit
7fe25fe28f
1 changed files with 8 additions and 4 deletions
|
@ -11,22 +11,25 @@ describe "Getting all docs", ->
|
|||
@project_id = ObjectId()
|
||||
@docs = [{
|
||||
_id: ObjectId()
|
||||
lines: ["one"]
|
||||
lines: ["one", "two", "three"]
|
||||
rev: 2
|
||||
}, {
|
||||
_id: ObjectId()
|
||||
lines: ["two"]
|
||||
lines: ["aaa", "bbb", "ccc"]
|
||||
rev: 4
|
||||
}, {
|
||||
_id: ObjectId()
|
||||
lines: ["three"]
|
||||
lines: ["111", "222", "333"]
|
||||
rev: 6
|
||||
}]
|
||||
DocstoreClient.createProject @project_id, (error) =>
|
||||
throw error if error?
|
||||
jobs = for doc in @docs
|
||||
do (doc) =>
|
||||
(callback) => DocstoreClient.createDoc @project_id, doc._id, doc.lines, callback
|
||||
(callback) =>
|
||||
DocstoreClient.createDoc @project_id, doc._id, doc.lines, (err)=>
|
||||
doc.lines[0] = doc.lines[0]+" added"
|
||||
DocstoreClient.updateDoc @project_id, doc._id, doc.lines, callback
|
||||
async.series jobs, done
|
||||
|
||||
afterEach (done) ->
|
||||
|
@ -40,3 +43,4 @@ describe "Getting all docs", ->
|
|||
doc.lines.should.deep.equal @docs[i].lines
|
||||
done()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue