mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
Merge pull request #26 from sharelatex/sk-upgrade-mongojs
Upgrade mongojs dependency to version 2.4.0
This commit is contained in:
commit
3cb59f365f
4 changed files with 11 additions and 11 deletions
|
@ -1,6 +1,6 @@
|
||||||
Settings = require "settings-sharelatex"
|
Settings = require "settings-sharelatex"
|
||||||
mongojs = require "mongojs"
|
mongojs = require "mongojs"
|
||||||
db = mongojs.connect(Settings.mongo.url, ["docs", "docOps"])
|
db = mongojs(Settings.mongo.url, ["docs", "docOps"])
|
||||||
module.exports =
|
module.exports =
|
||||||
db: db
|
db: db
|
||||||
ObjectId: mongojs.ObjectId
|
ObjectId: mongojs.ObjectId
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
"settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0",
|
"settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0",
|
||||||
"logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.4.0",
|
"logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.4.0",
|
||||||
"metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.7.1",
|
"metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.7.1",
|
||||||
"mongojs": "0.18.2",
|
"mongojs": "2.4.0",
|
||||||
"express": "~4.1.1",
|
"express": "~4.1.1",
|
||||||
"underscore": "~1.6.0",
|
"underscore": "~1.6.0",
|
||||||
"body-parser": "~1.0.2",
|
"body-parser": "~1.0.2",
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
"grunt": "~0.4.4",
|
"grunt": "~0.4.4",
|
||||||
"bunyan": "~0.22.3",
|
"bunyan": "~0.22.3",
|
||||||
"grunt-bunyan": "~0.5.0",
|
"grunt-bunyan": "~0.5.0",
|
||||||
"sinon": "~1.5.2",
|
"sinon": "~3.2.1",
|
||||||
"sandboxed-module": "~0.3.0",
|
"sandboxed-module": "~0.3.0",
|
||||||
"chai": "~1.9.1",
|
"chai": "~1.9.1",
|
||||||
"grunt-forever": "~0.4.4",
|
"grunt-forever": "~0.4.4",
|
||||||
|
|
|
@ -184,7 +184,7 @@ describe "DocManager", ->
|
||||||
|
|
||||||
it "should return a NotFoundError", ->
|
it "should return a NotFoundError", ->
|
||||||
@callback
|
@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
|
.should.equal true
|
||||||
|
|
||||||
describe "getAllNonDeletedDocs", ->
|
describe "getAllNonDeletedDocs", ->
|
||||||
|
@ -212,7 +212,7 @@ describe "DocManager", ->
|
||||||
|
|
||||||
it "should return a NotFoundError", ->
|
it "should return a NotFoundError", ->
|
||||||
@callback
|
@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
|
.should.equal true
|
||||||
|
|
||||||
describe "deleteDoc", ->
|
describe "deleteDoc", ->
|
||||||
|
@ -244,7 +244,7 @@ describe "DocManager", ->
|
||||||
|
|
||||||
it "should return a NotFoundError", ->
|
it "should return a NotFoundError", ->
|
||||||
@callback
|
@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
|
.should.equal true
|
||||||
|
|
||||||
describe "updateDoc", ->
|
describe "updateDoc", ->
|
||||||
|
@ -349,21 +349,21 @@ describe "DocManager", ->
|
||||||
@DocManager.updateDoc @project_id, @doc_id, @newDocLines, null, @originalRanges, @callback
|
@DocManager.updateDoc @project_id, @doc_id, @newDocLines, null, @originalRanges, @callback
|
||||||
|
|
||||||
it "should return an error", ->
|
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", ->
|
describe "when the lines are null", ->
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@DocManager.updateDoc @project_id, @doc_id, null, @version, @originalRanges, @callback
|
@DocManager.updateDoc @project_id, @doc_id, null, @version, @originalRanges, @callback
|
||||||
|
|
||||||
it "should return an error", ->
|
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", ->
|
describe "when the ranges are null", ->
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@DocManager.updateDoc @project_id, @doc_id, @newDocLines, @version, null, @callback
|
@DocManager.updateDoc @project_id, @doc_id, @newDocLines, @version, null, @callback
|
||||||
|
|
||||||
it "should return an error", ->
|
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", ->
|
describe "when there is a generic error getting the doc", ->
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
|
|
|
@ -174,7 +174,7 @@ describe "HttpController", ->
|
||||||
it "should log out an error", ->
|
it "should log out an error", ->
|
||||||
@logger.error
|
@logger.error
|
||||||
.calledWith(
|
.calledWith(
|
||||||
err: new Error("null doc")
|
err: sinon.match.has('message', "null doc")
|
||||||
project_id: @project_id
|
project_id: @project_id
|
||||||
"encountered null doc"
|
"encountered null doc"
|
||||||
)
|
)
|
||||||
|
@ -325,4 +325,4 @@ describe "HttpController", ->
|
||||||
it "should return a 204 (No Content)", ->
|
it "should return a 204 (No Content)", ->
|
||||||
@res.send
|
@res.send
|
||||||
.calledWith(204)
|
.calledWith(204)
|
||||||
.should.equal true
|
.should.equal true
|
||||||
|
|
Loading…
Reference in a new issue