Skip to content

Commit

Permalink
add request timestamp and fix casing (#2664)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelhorwitz authored and harpere committed Jun 22, 2018
1 parent afd974b commit 30f7665
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion modules/kargoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ export const spec = {
timeout: bidderRequest.timeout,
currency: currency,
cpmGranularity: 1,
timestamp: (new Date()).getTime(),
cpmRange: {
floor: 0,
ceil: 20
},
adSlotIds: utils._map(validBidRequests, bid => bid.params.placementId)
adSlotIDs: utils._map(validBidRequests, bid => bid.params.placementId)
}, spec._getAllMetadata());
const encodedParams = encodeURIComponent(JSON.stringify(transformedParams));
return Object.assign({}, bidderRequest, {
Expand Down
7 changes: 5 additions & 2 deletions test/spec/modules/kargoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import {registerBidder} from 'src/adapters/bidderFactory';
import {config} from 'src/config';

describe('kargo adapter tests', function () {
var sandbox;
var sandbox, clock, frozenNow = new Date();

beforeEach(() => {
sandbox = sinon.sandbox.create();
clock = sinon.useFakeTimers(frozenNow.getTime());
});

afterEach(() => {
sandbox.restore();
clock.restore();
});

describe('bid request validity', function() {
Expand Down Expand Up @@ -166,11 +168,12 @@ describe('kargo adapter tests', function () {
timeout: 200,
currency: 'USD',
cpmGranularity: 1,
timestamp: frozenNow.getTime(),
cpmRange: {
floor: 0,
ceil: 20
},
adSlotIds: [
adSlotIDs: [
'foo',
'bar'
],
Expand Down

0 comments on commit 30f7665

Please sign in to comment.