From 2870714aa7c152f7f347cecd518ce0fd28cdeefd Mon Sep 17 00:00:00 2001 From: Robert Ray Martinez III Date: Wed, 29 May 2019 08:53:50 -0700 Subject: [PATCH] We want to remove bidfloor if not set by pb (#3866) --- modules/rubiconBidAdapter.js | 5 ++++- test/spec/modules/rubiconBidAdapter_spec.js | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/rubiconBidAdapter.js b/modules/rubiconBidAdapter.js index dd1c815150e..48ce6ae9648 100644 --- a/modules/rubiconBidAdapter.js +++ b/modules/rubiconBidAdapter.js @@ -134,7 +134,6 @@ export const spec = { }, tmax: config.getConfig('TTL') || 1000, imp: [{ - bidfloor: utils.deepAccess(bidRequest, 'params.floor') ? parseFloat(bidRequest.params.floor) : 0.0, exp: 300, id: bidRequest.adUnitCode, secure: isSecure() || bidRequest.params.secure ? 1 : 0, @@ -159,6 +158,10 @@ export const spec = { } } } + const bidFloor = parseFloat(utils.deepAccess(bidRequest, 'params.floor')); + if (!isNaN(bidFloor)) { + data.imp[0].bidfloor = bidFloor; + } // if value is set, will overwrite with same value data.imp[0].ext.rubicon.video.size_id = determineRubiconVideoSizeId(bidRequest) diff --git a/test/spec/modules/rubiconBidAdapter_spec.js b/test/spec/modules/rubiconBidAdapter_spec.js index 0f29afe0069..67a92d4a26e 100644 --- a/test/spec/modules/rubiconBidAdapter_spec.js +++ b/test/spec/modules/rubiconBidAdapter_spec.js @@ -1160,15 +1160,15 @@ describe('the rubicon adapter', function () { bidderRequest.bids[0].params.floor = 0; [request] = spec.buildRequests(bidderRequest.bids, bidderRequest); - expect(request.data.imp[0].bidfloor).to.equal(0.0); + expect(request.data.imp[0].bidfloor).to.equal(0); bidderRequest.bids[0].params.floor = undefined; [request] = spec.buildRequests(bidderRequest.bids, bidderRequest); - expect(request.data.imp[0].bidfloor).to.equal(0.0); + expect(request.data.imp[0]).to.not.haveOwnProperty('bidfloor'); bidderRequest.bids[0].params.floor = null; [request] = spec.buildRequests(bidderRequest.bids, bidderRequest); - expect(request.data.imp[0].bidfloor).to.equal(0.0); + expect(request.data.imp[0]).to.not.haveOwnProperty('bidfloor'); }); it('should send request with proper ad position when mediaTypes.video.pos is not defined', function () {