mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-17 04:51:33 +00:00
Merge pull request #1309 from sharelatex/sk-git-bridge-acceptance-tests-2
Add more acceptance tests for git-bridge api GitOrigin-RevId: 404c857fb73686d7073cd314dd4ee050a5b2e3bc
This commit is contained in:
parent
7bf860cde5
commit
c313b255bb
1 changed files with 13 additions and 0 deletions
|
@ -13,9 +13,14 @@ module.exports = MockProjectHistoryApi =
|
|||
|
||||
labels: {}
|
||||
|
||||
projectSnapshots: {}
|
||||
|
||||
addOldFile: (project_id, version, pathname, content) ->
|
||||
@oldFiles["#{project_id}:#{version}:#{pathname}"] = content
|
||||
|
||||
addProjectSnapshot: (project_id, version, snapshot) ->
|
||||
@projectSnapshots["#{project_id}:#{version}"] = snapshot
|
||||
|
||||
setProjectVersion: (project_id, version) ->
|
||||
@projectVersions[project_id] = {version: version}
|
||||
|
||||
|
@ -52,6 +57,14 @@ module.exports = MockProjectHistoryApi =
|
|||
else
|
||||
res.send 404
|
||||
|
||||
app.get "/project/:project_id/version/:version", (req, res, next) =>
|
||||
{project_id, version} = req.params
|
||||
key = "#{project_id}:#{version}"
|
||||
if @projectSnapshots[key]?
|
||||
res.json @projectSnapshots[key]
|
||||
else
|
||||
res.sendStatus 404
|
||||
|
||||
app.get "/project/:project_id/version", (req, res, next) =>
|
||||
{project_id} = req.params
|
||||
if @projectVersions[project_id]?
|
||||
|
|
Loading…
Reference in a new issue