mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-11 05:25:22 +00:00
Fix check for hasSubscription
This commit is contained in:
parent
f7b19d9183
commit
0edd2b5fe7
2 changed files with 15 additions and 1 deletions
services/web
app/coffee/Features/Project
test/unit/coffee/Project
|
@ -214,7 +214,7 @@ module.exports = ProjectController =
|
|||
tags: tags
|
||||
notifications: notifications or []
|
||||
user: user
|
||||
hasSubscription: results.hasSubscription[0]
|
||||
hasSubscription: results.hasSubscription
|
||||
isShowingV1Projects: results.v1Projects?
|
||||
warnings: warnings
|
||||
}
|
||||
|
|
|
@ -305,6 +305,20 @@ describe "ProjectController", ->
|
|||
done()
|
||||
@ProjectController.projectListPage @req, @res
|
||||
|
||||
it 'should send hasSubscription == false when no subscription', (done) ->
|
||||
@res.render = (pageName, opts)=>
|
||||
opts.hasSubscription.should.equal false
|
||||
done()
|
||||
@ProjectController.projectListPage @req, @res
|
||||
|
||||
it 'should send hasSubscription == true when there is a subscription', (done) ->
|
||||
@LimitationsManager.userHasSubscriptionOrIsGroupMember = sinon.stub().callsArgWith(1, null, true)
|
||||
@res.render = (pageName, opts)=>
|
||||
opts.hasSubscription.should.equal true
|
||||
done()
|
||||
@ProjectController.projectListPage @req, @res
|
||||
|
||||
|
||||
describe 'front widget', (done) ->
|
||||
beforeEach ->
|
||||
@settings.overleaf =
|
||||
|
|
Loading…
Add table
Reference in a new issue