Skip to content
Snippets Groups Projects
Verified Commit 9d3b2e08 authored by James Allen's avatar James Allen Committed by David Mehren
Browse files

Fix check for hasSubscription

parent b2927b62
No related branches found
No related tags found
No related merge requests found
...@@ -214,7 +214,7 @@ module.exports = ProjectController = ...@@ -214,7 +214,7 @@ module.exports = ProjectController =
tags: tags tags: tags
notifications: notifications or [] notifications: notifications or []
user: user user: user
hasSubscription: results.hasSubscription[0] hasSubscription: results.hasSubscription
isShowingV1Projects: results.v1Projects? isShowingV1Projects: results.v1Projects?
warnings: warnings warnings: warnings
} }
......
...@@ -305,6 +305,20 @@ describe "ProjectController", -> ...@@ -305,6 +305,20 @@ describe "ProjectController", ->
done() done()
@ProjectController.projectListPage @req, @res @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) -> describe 'front widget', (done) ->
beforeEach -> beforeEach ->
@settings.overleaf = @settings.overleaf =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment