|
|
@@ -184,7 +184,7 @@ describe "DocManager", ->
|
|
|
|
|
|
it "should return a NotFoundError", ->
|
|
|
@callback
|
|
|
- .calledWith(new Errors.NotFoundError("No such doc: #{@doc_id} in project #{@project_id}"))
|
|
|
+ .calledWith(sinon.match.has('message', "No such doc: #{@doc_id} in project #{@project_id}"))
|
|
|
.should.equal true
|
|
|
|
|
|
describe "getAllNonDeletedDocs", ->
|
|
|
@@ -212,7 +212,7 @@ describe "DocManager", ->
|
|
|
|
|
|
it "should return a NotFoundError", ->
|
|
|
@callback
|
|
|
- .calledWith(new Errors.NotFoundError("No docs for project #{@project_id}"))
|
|
|
+ .calledWith(sinon.match.has('message', "No docs for project #{@project_id}"))
|
|
|
.should.equal true
|
|
|
|
|
|
describe "deleteDoc", ->
|
|
|
@@ -244,7 +244,7 @@ describe "DocManager", ->
|
|
|
|
|
|
it "should return a NotFoundError", ->
|
|
|
@callback
|
|
|
- .calledWith(new Errors.NotFoundError("No such doc: #{@doc_id}"))
|
|
|
+ .calledWith(sinon.match.has('message', "No such project/doc to delete: #{@project_id}/#{@doc_id}"))
|
|
|
.should.equal true
|
|
|
|
|
|
describe "updateDoc", ->
|
|
|
@@ -349,21 +349,21 @@ describe "DocManager", ->
|
|
|
@DocManager.updateDoc @project_id, @doc_id, @newDocLines, null, @originalRanges, @callback
|
|
|
|
|
|
it "should return an error", ->
|
|
|
- @callback.calledWith(new Error("no lines, version or ranges provided")).should.equal true
|
|
|
+ @callback.calledWith(sinon.match.has('message', "no lines, version or ranges provided")).should.equal true
|
|
|
|
|
|
describe "when the lines are null", ->
|
|
|
beforeEach ->
|
|
|
@DocManager.updateDoc @project_id, @doc_id, null, @version, @originalRanges, @callback
|
|
|
|
|
|
it "should return an error", ->
|
|
|
- @callback.calledWith(new Error("no lines, version or ranges provided")).should.equal true
|
|
|
+ @callback.calledWith(sinon.match.has('message', "no lines, version or ranges provided")).should.equal true
|
|
|
|
|
|
describe "when the ranges are null", ->
|
|
|
beforeEach ->
|
|
|
@DocManager.updateDoc @project_id, @doc_id, @newDocLines, @version, null, @callback
|
|
|
|
|
|
it "should return an error", ->
|
|
|
- @callback.calledWith(new Error("no lines, version or ranges provided")).should.equal true
|
|
|
+ @callback.calledWith(sinon.match.has('message', "no lines, version or ranges provided")).should.equal true
|
|
|
|
|
|
describe "when there is a generic error getting the doc", ->
|
|
|
beforeEach ->
|