Skip to content

Commit

Permalink
Rubicon Video COPPA fix (prebid#4155)
Browse files Browse the repository at this point in the history
* Rubicon Video COPPA fix

* Unit test for Rubicon Video COPPA fix
  • Loading branch information
umbrella-artem-seryak authored and sa1omon committed Nov 28, 2019
1 parent f720f1e commit 556f7ca
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export const spec = {
}

if (config.getConfig('coppa') === true) {
utils.deepSetValue(request, 'regs.coppa', 1);
utils.deepSetValue(data, 'regs.coppa', 1);
}

return {
Expand Down
18 changes: 18 additions & 0 deletions test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1356,6 +1356,24 @@ describe('the rubicon adapter', function () {
expect(requests.length).to.equal(1);
expect(requests[0].url).to.equal(FASTLANE_ENDPOINT);
});

it('should include coppa flag in video bid request', () => {
createVideoBidderRequest();

sandbox.stub(Date, 'now').callsFake(() =>
bidderRequest.auctionStart + 100
);

sandbox.stub(config, 'getConfig').callsFake(key => {
const config = {
'coppa': true
};
return config[key];
});

const [request] = spec.buildRequests(bidderRequest.bids, bidderRequest);
expect(request.data.regs.coppa).to.equal(1);
});
});

describe('combineSlotUrlParams', function () {
Expand Down

0 comments on commit 556f7ca

Please sign in to comment.