mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Restore user features to default after acceptance test.
Fixes an issue that could come up when running the tests several times.
This commit is contained in:
parent
f7073c4a3c
commit
7bb4638186
2 changed files with 8 additions and 0 deletions
|
@ -35,6 +35,8 @@ describe "ProjectFeatures", ->
|
|||
describe "with an upgraded account", ->
|
||||
before (done) ->
|
||||
@owner.upgradeFeatures done
|
||||
after (done) ->
|
||||
@owner.defaultFeatures done
|
||||
|
||||
it "should have premium features", (done) ->
|
||||
joinProject @owner._id, @project_id, (error, response, body) ->
|
||||
|
@ -47,6 +49,8 @@ describe "ProjectFeatures", ->
|
|||
describe "with an basic account", ->
|
||||
before (done) ->
|
||||
@owner.downgradeFeatures done
|
||||
after (done) ->
|
||||
@owner.defaultFeatures done
|
||||
|
||||
it "should have basic features", (done) ->
|
||||
joinProject @owner._id, @project_id, (error, response, body) ->
|
||||
|
|
|
@ -79,6 +79,10 @@ class User
|
|||
}
|
||||
db.users.update {_id: ObjectId(@id)}, { $set: { features: features }}, callback
|
||||
|
||||
defaultFeatures: (callback = (error) -> ) ->
|
||||
features = settings.defaultFeatures
|
||||
db.users.update {_id: ObjectId(@id)}, { $set: { features: features }}, callback
|
||||
|
||||
createProject: (name, callback = (error, project_id) ->) ->
|
||||
@request.post {
|
||||
url: "/project/new",
|
||||
|
|
Loading…
Reference in a new issue