Просмотр исходного кода

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

Remove redundant sandboxed module require in tests

GitOrigin-RevId: 957af70aacefed34f853549ef2357f59c01a4b3e
James Allen 8 лет назад
Родитель
Сommit
79a7a596b0

+ 1 - 24
services/web/test/unit/coffee/Subscription/SubscriptionControllerTests.coffee

@@ -115,31 +115,8 @@ describe "SubscriptionController", ->
 
 		describe 'when user is not logged in', (done) ->
 			beforeEach (done) ->
-				@UserGetter =
-					getUser: sinon.stub().callsArgWith(2, null, null)
 				@res.callback = done
-				@AuthenticationController =
-					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
-
+				@AuthenticationController.getLoggedInUserId = sinon.stub().returns(null)
 				@SubscriptionController.plansPage(@req, @res)
 
 			it 'should not fetch the current user', (done) ->