Просмотр исходного кода

improved docstore acceptence tests to deal with changing docs on get all docs

Henry Oswald 11 лет назад
Родитель
Сommit
7fe25fe28f
1 измененных файлов с 8 добавлено и 4 удалено
  1. 8 4
      services/docstore/test/acceptance/coffee/GettingAllDocsTests.coffee

+ 8 - 4
services/docstore/test/acceptance/coffee/GettingAllDocsTests.coffee

@@ -11,22 +11,25 @@ describe "Getting all docs", ->
 		@project_id = ObjectId()
 		@project_id = ObjectId()
 		@docs = [{
 		@docs = [{
 			_id: ObjectId()
 			_id: ObjectId()
-			lines: ["one"]
+			lines: ["one", "two", "three"]
 			rev: 2
 			rev: 2
 		}, {
 		}, {
 			_id: ObjectId()
 			_id: ObjectId()
-			lines: ["two"]
+			lines: ["aaa", "bbb", "ccc"]
 			rev: 4
 			rev: 4
 		}, {
 		}, {
 			_id: ObjectId()
 			_id: ObjectId()
-			lines: ["three"]
+			lines: ["111", "222", "333"]
 			rev: 6
 			rev: 6
 		}]
 		}]
 		DocstoreClient.createProject @project_id, (error) =>
 		DocstoreClient.createProject @project_id, (error) =>
 			throw error if error?
 			throw error if error?
 			jobs = for doc in @docs
 			jobs = for doc in @docs
 				do (doc) =>
 				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 
 			async.series jobs, done 
 
 
 	afterEach (done) ->
 	afterEach (done) ->
@@ -40,3 +43,4 @@ describe "Getting all docs", ->
 				doc.lines.should.deep.equal @docs[i].lines
 				doc.lines.should.deep.equal @docs[i].lines
 			done()
 			done()
 
 
+