Skip to content

Commit

Permalink
[Update] Change name BidAdapter and some fix (prebid#3118)
Browse files Browse the repository at this point in the history
* Add: rxrtb prebidAdapter

* Update: params for test

* Update: code format

* Update: code format

* Update: code format

* Fix param check

* Update rxrtbBidAdapter.js

* Remove required source param

* Update and rename rxrtbBidAdapter.js to rexrtbBidAdapter.js

* Update and rename rxrtbBidAdapter.md to rexrtbBidAdapter.md

* Update and rename rxrtbBidAdapter_spec.js to rexrtbBidAdapter_spec.js

* Revert "Update rxrtbBidAdapter.js"

This reverts commit 09bca02.

* Revert "Update and rename rxrtbBidAdapter_spec.js to rexrtbBidAdapter_spec.js"

This reverts commit 2481c58.

* Revert "Update and rename rxrtbBidAdapter.md to rexrtbBidAdapter.md"

This reverts commit af9a491.

* Revert "Update and rename rxrtbBidAdapter.js to rexrtbBidAdapter.js"

This reverts commit 81a17ad.

* Revert "Remove required source param"

This reverts commit 38b273d.

*  Revert "Update rxrtbBidAdapter.js"

* Update and rename rexrtbPrebid
  • Loading branch information
prebidRxRTB authored and SublimeJeremy committed Oct 1, 2018
1 parent aa8c343 commit 83087b3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 30 deletions.
12 changes: 5 additions & 7 deletions modules/rxrtbBidAdapter.js → modules/rexrtbBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {BANNER} from 'src/mediaTypes';
import {registerBidder} from 'src/adapters/bidderFactory';
import {config} from 'src/config';

const BIDDER_CODE = 'rxrtb';
const BIDDER_CODE = 'rexrtb';
const DEFAULT_HOST = 'bid.rxrtb.bid';
const AUCTION_TYPE = 2;
const RESPONSE_TTL = 900;
Expand All @@ -12,7 +12,7 @@ export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [BANNER],
isBidRequestValid: function (bidRequest) {
return 'params' in bidRequest && bidRequest.params.source !== undefined && bidRequest.params.id !== undefined && utils.isInteger(bidRequest.params.id) && bidRequest.params.token !== undefined;
return 'params' in bidRequest && bidRequest.params.id !== undefined && utils.isInteger(bidRequest.params.id) && bidRequest.params.token !== undefined;
},
buildRequests: function (validBidRequests) {
var requests = [];
Expand Down Expand Up @@ -62,7 +62,6 @@ registerBidder(spec);
function getDomain(url) {
var a = document.createElement('a');
a.href = url;

return a.host;
}

Expand Down Expand Up @@ -99,11 +98,9 @@ function makeImp(req) {
'tagid': req.adUnitCode,
'banner': makeBanner(req)
};

if (req.params.bidfloor && isFinite(req.params.bidfloor)) {
imp.bidfloor = req.params.bidfloor
}

return imp;
}

Expand All @@ -124,9 +121,10 @@ function makeBanner(req) {
}

function makeSite(req) {
let domain = getDomain(config.getConfig('publisherDomain'));
return {
'id': req.params.source,
'domain': getDomain(config.getConfig('publisherDomain')),
'id': req.params.source || domain,
'domain': domain,
'page': utils.getTopWindowUrl(),
'ref': utils.getTopWindowReferrer()
};
Expand Down
8 changes: 4 additions & 4 deletions modules/rxrtbBidAdapter.md → modules/rexrtbBidAdapter.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Overview

Module Name: rxrtb Bidder Adapter
Module Name: REXRTB Bidder Adapter

Module Type: Bidder Adapter

Maintainer: contact@picellaltd.com
Maintainer: tech@rexrtb.com


# Description

Module that connects to rxrtb's demand source
Module that connects to REXRTB's demand source

# Test Parameters
```javascript
Expand All @@ -19,7 +19,7 @@ Module that connects to rxrtb's demand source
sizes: [[728, 98]],
bids: [
{
bidder: 'rxrtb',
bidder: 'rexrtb',
params: {
id: 89,
token: '658f11a5efbbce2f9be3f1f146fcbc22',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {expect} from 'chai';
import {spec} from 'modules/rxrtbBidAdapter';
import {spec} from 'modules/rexrtbBidAdapter';

describe('rxrtb adapater', function () {
describe('rexrtb adapater', function () {
describe('Test validate req', function () {
it('should accept minimum valid bid', function () {
let bid = {
bidder: 'rxrtb',
bidder: 'rexrtb',
params: {
id: 89,
token: '658f11a5efbbce2f9be3f1f146fcbc22',
Expand All @@ -19,7 +19,7 @@ describe('rxrtb adapater', function () {

it('should reject missing id', function () {
let bid = {
bidder: 'rxrtb',
bidder: 'rexrtb',
params: {
token: '658f11a5efbbce2f9be3f1f146fcbc22',
source: 'prebidtest'
Expand All @@ -32,7 +32,7 @@ describe('rxrtb adapater', function () {

it('should reject id not Integer', function () {
let bid = {
bidder: 'rxrtb',
bidder: 'rexrtb',
params: {
id: '123',
token: '658f11a5efbbce2f9be3f1f146fcbc22',
Expand All @@ -43,25 +43,12 @@ describe('rxrtb adapater', function () {

expect(isValid).to.equal(false);
});

it('should reject missing source', function () {
let bid = {
bidder: 'rxrtb',
params: {
id: 89,
token: '658f11a5efbbce2f9be3f1f146fcbc22'
}
};
const isValid = spec.isBidRequestValid(bid);

expect(isValid).to.equal(false);
});
});

describe('Test build request', function () {
it('minimum request', function () {
let bid = {
bidder: 'rxrtb',
bidder: 'rexrtb',
sizes: [[728, 90]],
bidId: '4d0a6829338a07',
adUnitCode: 'div-gpt-ad-1460505748561-0',
Expand Down

0 comments on commit 83087b3

Please sign in to comment.