Merge pull request #1247 from sharelatex/sk-git-bridge-acceptance-tests

Git bridge acceptance tests (initial)

GitOrigin-RevId: 66736ed568296674046b368861446eeb6eae664b
This commit is contained in:
Shane Kilkelly 2018-12-13 14:50:02 +00:00 committed by sharelatex
parent c423e483ba
commit 1836932256
2 changed files with 11 additions and 2 deletions

View file

@ -47,6 +47,9 @@ module.exports = MockDocUpdaterApi =
app.delete "/project/:project_id/doc/:doc_id", (req, res, next) =>
res.sendStatus 204
app.post "/project/:project_id/history/resync", (req, res, next) =>
res.sendStatus 204
app.listen 3003, (error) ->
throw error if error?
.on "error", (error) ->

View file

@ -17,7 +17,10 @@ module.exports = MockProjectHistoryApi =
@oldFiles["#{project_id}:#{version}:#{pathname}"] = content
setProjectVersion: (project_id, version) ->
@projectVersions[project_id] = version
@projectVersions[project_id] = {version: version}
setProjectVersionInfo: (project_id, versionInfo) ->
@projectVersions[project_id] = versionInfo
addLabel: (project_id, label_id, comment, version) ->
@labels[project_id] ?= {}
@ -50,7 +53,7 @@ module.exports = MockProjectHistoryApi =
app.get "/project/:project_id/version", (req, res, next) =>
{project_id} = req.params
if @projectVersions[project_id]?
res.json version: @projectVersions[project_id]
res.json @projectVersions[project_id]
else
res.send 404
@ -78,6 +81,9 @@ module.exports = MockProjectHistoryApi =
else
res.send 404
app.post "/project/:project_id/flush", (req, res, next) =>
res.sendStatus 200
app.listen 3054, (error) ->
throw error if error?
.on "error", (error) ->