@@ -279,6 +279,7 @@ describe('the rubicon adapter', function () {
279
279
accountId : '14062' ,
280
280
siteId : '70608' ,
281
281
zoneId : '335918' ,
282
+ pchain : 'GAM:11111-reseller1:22222' ,
282
283
userId : '12346' ,
283
284
keywords : [ 'a' , 'b' , 'c' ] ,
284
285
inventory : {
@@ -360,7 +361,7 @@ describe('the rubicon adapter', function () {
360
361
describe ( 'buildRequests implementation' , function ( ) {
361
362
describe ( 'for requests' , function ( ) {
362
363
describe ( 'to fastlane' , function ( ) {
363
- it ( 'should make a well-formed request objects ' , function ( ) {
364
+ it ( 'should make a well-formed request object ' , function ( ) {
364
365
sandbox . stub ( Math , 'random' ) . callsFake ( ( ) => 0.1 ) ;
365
366
let [ request ] = spec . buildRequests ( bidderRequest . bids , bidderRequest ) ;
366
367
let data = parseQuery ( request . data ) ;
@@ -379,6 +380,7 @@ describe('the rubicon adapter', function () {
379
380
'rand' : '0.1' ,
380
381
'tk_flint' : INTEGRATION ,
381
382
'x_source.tid' : 'd45dd707-a418-42ec-b8a7-b70a6c6fab0b' ,
383
+ 'x_source.pchain' : 'GAM:11111-reseller1:22222' ,
382
384
'p_screen_res' : / \d + x \d + / ,
383
385
'tk_user_key' : '12346' ,
384
386
'kw' : 'a,b,c' ,
@@ -460,11 +462,20 @@ describe('the rubicon adapter', function () {
460
462
expect ( data [ 'p_pos' ] ) . to . equal ( 'atf;;btf;;' ) ;
461
463
} ) ;
462
464
465
+ it ( 'should not send x_source.pchain to AE if params.pchain is not specified' , function ( ) {
466
+ var noPchainRequest = utils . deepClone ( bidderRequest ) ;
467
+ delete noPchainRequest . bids [ 0 ] . params . pchain ;
468
+
469
+ let [ request ] = spec . buildRequests ( noPchainRequest . bids , noPchainRequest ) ;
470
+ expect ( request . data ) . to . contain ( '&site_id=70608&' ) ;
471
+ expect ( request . data ) . to . not . contain ( 'x_source.pchain' ) ;
472
+ } ) ;
473
+
463
474
it ( 'ad engine query params should be ordered correctly' , function ( ) {
464
475
sandbox . stub ( Math , 'random' ) . callsFake ( ( ) => 0.1 ) ;
465
476
let [ request ] = spec . buildRequests ( bidderRequest . bids , bidderRequest ) ;
466
477
467
- const referenceOrdering = [ 'account_id' , 'site_id' , 'zone_id' , 'size_id' , 'alt_size_ids' , 'p_pos' , 'rf' , 'p_geo.latitude' , 'p_geo.longitude' , 'kw' , 'tg_v.ucat' , 'tg_v.lastsearch' , 'tg_v.likes' , 'tg_i.rating' , 'tg_i.prodtype' , 'tk_flint' , 'x_source.tid' , 'p_screen_res' , 'rp_floor' , 'rp_secure' , 'tk_user_key' , 'tg_fl.eid' , 'slots' , 'rand' ] ;
478
+ const referenceOrdering = [ 'account_id' , 'site_id' , 'zone_id' , 'size_id' , 'alt_size_ids' , 'p_pos' , 'rf' , 'p_geo.latitude' , 'p_geo.longitude' , 'kw' , 'tg_v.ucat' , 'tg_v.lastsearch' , 'tg_v.likes' , 'tg_i.rating' , 'tg_i.prodtype' , 'tk_flint' , 'x_source.tid' , 'x_source.pchain' , ' p_screen_res', 'rp_floor' , 'rp_secure' , 'tk_user_key' , 'tg_fl.eid' , 'slots' , 'rand' ] ;
468
479
469
480
request . data . split ( '&' ) . forEach ( ( item , i ) => {
470
481
expect ( item . split ( '=' ) [ 0 ] ) . to . equal ( referenceOrdering [ i ] ) ;
0 commit comments