Merge pull request #1793 from overleaf/fix-name-removed-transfer-ownership

Fix name removed transfer ownership

GitOrigin-RevId: ccbc681746033017686c4e36040a71ab7f98ad16
This commit is contained in:
Simon Detheridge 2019-05-20 13:07:54 +01:00 committed by sharelatex
parent 02c4edcb1c
commit efd7cf5b01
3 changed files with 4 additions and 4 deletions

View file

@ -43,13 +43,13 @@ Unit tests can be run in the `test_unit` container defined in `docker-compose.te
The makefile contains a short cut to run these:
```
make unit_test
make test_unit
```
During development it is often useful to only run a subset of tests, which can be configured with arguments to the mocha CLI:
```
make unit_test MOCHA_ARGS='--grep=AuthorizationManager'
make test_unit MOCHA_GREP='AuthorizationManager'
```
### Acceptance Tests

View file

@ -51,7 +51,7 @@ module.exports = ProjectDetailsHandler =
if typeof suffix is 'function'
callback = suffix
suffix = ''
ProjectGetter.getProject project_id, {owner_ref: true}, (err, project)->
ProjectGetter.getProject project_id, {owner_ref: true, name: true}, (err, project)->
return callback(err) if err?
return callback(new Errors.NotFoundError("project not found")) unless project?
return callback() if project.owner_ref == user_id

View file

@ -104,7 +104,7 @@ describe 'ProjectDetailsHandler', ->
it "should transfer ownership of the project", (done) ->
@handler.transferOwnership 'abc', '123', () =>
sinon.assert.calledWith(@ProjectModel.update, {_id: 'abc'})
sinon.assert.calledWith(@ProjectModel.update, {_id: 'abc'}, sinon.match({$set: {name: 'teapot'}}))
done()
it "should flush the project to tpds", (done) ->