mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 13:53:40 -05:00
Merge pull request #1793 from overleaf/fix-name-removed-transfer-ownership
Fix name removed transfer ownership GitOrigin-RevId: ccbc681746033017686c4e36040a71ab7f98ad16
This commit is contained in:
parent
02c4edcb1c
commit
efd7cf5b01
3 changed files with 4 additions and 4 deletions
|
@ -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:
|
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:
|
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
|
### Acceptance Tests
|
||||||
|
|
|
@ -51,7 +51,7 @@ module.exports = ProjectDetailsHandler =
|
||||||
if typeof suffix is 'function'
|
if typeof suffix is 'function'
|
||||||
callback = suffix
|
callback = suffix
|
||||||
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(err) if err?
|
||||||
return callback(new Errors.NotFoundError("project not found")) unless project?
|
return callback(new Errors.NotFoundError("project not found")) unless project?
|
||||||
return callback() if project.owner_ref == user_id
|
return callback() if project.owner_ref == user_id
|
||||||
|
|
|
@ -104,7 +104,7 @@ describe 'ProjectDetailsHandler', ->
|
||||||
|
|
||||||
it "should transfer ownership of the project", (done) ->
|
it "should transfer ownership of the project", (done) ->
|
||||||
@handler.transferOwnership 'abc', '123', () =>
|
@handler.transferOwnership 'abc', '123', () =>
|
||||||
sinon.assert.calledWith(@ProjectModel.update, {_id: 'abc'})
|
sinon.assert.calledWith(@ProjectModel.update, {_id: 'abc'}, sinon.match({$set: {name: 'teapot'}}))
|
||||||
done()
|
done()
|
||||||
|
|
||||||
it "should flush the project to tpds", (done) ->
|
it "should flush the project to tpds", (done) ->
|
||||||
|
|
Loading…
Reference in a new issue