Merge pull request #1228 from sharelatex/ja-fix-subscription-tests

Remove redundant sandboxed module require in tests

GitOrigin-RevId: 957af70aacefed34f853549ef2357f59c01a4b3e
This commit is contained in:
James Allen 2018-12-05 13:02:04 +01:00 committed by sharelatex
parent 16e1980b41
commit 79a7a596b0

View file

@ -115,31 +115,8 @@ describe "SubscriptionController", ->
describe 'when user is not logged in', (done) -> describe 'when user is not logged in', (done) ->
beforeEach (done) -> beforeEach (done) ->
@UserGetter =
getUser: sinon.stub().callsArgWith(2, null, null)
@res.callback = done @res.callback = done
@AuthenticationController = @AuthenticationController.getLoggedInUserId = sinon.stub().returns(null)
getLoggedInUser: sinon.stub().callsArgWith(1, null, null)
getLoggedInUserId: sinon.stub().returns(null)
getSessionUser: sinon.stub().returns(null)
isUserLoggedIn: sinon.stub().returns(false)
@SubscriptionController = SandboxedModule.require modulePath, requires:
'../Authentication/AuthenticationController': @AuthenticationController
'./SubscriptionHandler': @SubscriptionHandler
"./PlansLocator": @PlansLocator
'./SubscriptionViewModelBuilder': @SubscriptionViewModelBuilder
"./LimitationsManager": @LimitationsManager
"../../infrastructure/GeoIpLookup":@GeoIpLookup
"logger-sharelatex":
log:->
warn:->
"settings-sharelatex": @settings
"./SubscriptionDomainHandler":@SubscriptionDomainHandler
"../User/UserGetter": @UserGetter
"./RecurlyWrapper": @RecurlyWrapper = {}
"./FeaturesUpdater": @FeaturesUpdater = {}
"./GroupPlansData": @GroupPlansData
@SubscriptionController.plansPage(@req, @res) @SubscriptionController.plansPage(@req, @res)
it 'should not fetch the current user', (done) -> it 'should not fetch the current user', (done) ->