@@ -407,17 +407,19 @@ function(test) {
407
407
var req = { url : "/web/sockjs/info" } ;
408
408
var res = { writeHead : sinon . stub ( ) , end : sinon . stub ( ) } ;
409
409
410
- WithCluster ( { _uiService : uiService } , function ( ) {
411
- WithDiscovery ( discovery , function ( ) {
412
- Balancer . _sendSockJsInfo ( req , res , cookies ) ;
413
-
414
- test . isTrue ( discovery . endpointToHash . calledWith ( endpoint ) ) ;
415
- var info = JSON . parse ( res . end . firstCall . args [ 0 ] ) ;
416
- test . equal ( info . base_url , format ( endpoint + "/cluster-ddp/%s/web" , hash ) ) ;
417
- test . equal ( info . websocket , true ) ;
418
-
419
- balancerMock . verify ( ) ;
420
- balancerMock . restore ( ) ;
410
+ WithNew ( process . env , { "ROOT_URL" : endpoint } , function ( ) {
411
+ WithCluster ( { _uiService : uiService } , function ( ) {
412
+ WithDiscovery ( discovery , function ( ) {
413
+ Balancer . _sendSockJsInfo ( req , res , cookies ) ;
414
+
415
+ test . isTrue ( discovery . endpointToHash . calledWith ( endpoint ) ) ;
416
+ var info = JSON . parse ( res . end . firstCall . args [ 0 ] ) ;
417
+ test . equal ( info . base_url , format ( endpoint + "/cluster-ddp/%s/web" , hash ) ) ;
418
+ test . equal ( info . websocket , true ) ;
419
+
420
+ balancerMock . verify ( ) ;
421
+ balancerMock . restore ( ) ;
422
+ } ) ;
421
423
} ) ;
422
424
} ) ;
423
425
} ) ;
@@ -447,17 +449,19 @@ function(test) {
447
449
var req = { url : "/web/sockjs/info" } ;
448
450
var res = { writeHead : sinon . stub ( ) , end : sinon . stub ( ) } ;
449
451
450
- WithCluster ( { _uiService : uiService } , function ( ) {
451
- WithDiscovery ( discovery , function ( ) {
452
- Balancer . _sendSockJsInfo ( req , res , cookies ) ;
452
+ WithNew ( process . env , { "ROOT_URL" : endpoint } , function ( ) {
453
+ WithCluster ( { _uiService : uiService } , function ( ) {
454
+ WithDiscovery ( discovery , function ( ) {
455
+ Balancer . _sendSockJsInfo ( req , res , cookies ) ;
453
456
454
- test . isTrue ( discovery . endpointToHash . calledWith ( endpoint ) ) ;
455
- var info = JSON . parse ( res . end . firstCall . args [ 0 ] ) ;
456
- test . equal ( info . base_url , format ( endpoint + "/cluster-ddp/%s/web" , hash ) ) ;
457
- test . equal ( info . websocket , true ) ;
457
+ test . isTrue ( discovery . endpointToHash . calledWith ( endpoint ) ) ;
458
+ var info = JSON . parse ( res . end . firstCall . args [ 0 ] ) ;
459
+ test . equal ( info . base_url , format ( endpoint + "/cluster-ddp/%s/web" , hash ) ) ;
460
+ test . equal ( info . websocket , true ) ;
458
461
459
- balancerMock . verify ( ) ;
460
- balancerMock . restore ( ) ;
462
+ balancerMock . verify ( ) ;
463
+ balancerMock . restore ( ) ;
464
+ } ) ;
461
465
} ) ;
462
466
} ) ;
463
467
} ) ;
0 commit comments