Skip to content

Commit

Permalink
feat(amp-ads): Update Unruly loader URL
Browse files Browse the repository at this point in the history
  • Loading branch information
David Al-Kanani authored and AdSpacesDevelopers committed Aug 1, 2018
1 parent 17de093 commit 3f99a34
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ads/_config.js
Expand Up @@ -886,7 +886,7 @@ export const adConfig = {
},

'unruly': {
prefetch: 'https://video.unrulymedia.com/amp-demo/native-loader.js',
prefetch: 'https://video.unrulymedia.com/native/native-loader.js',
renderStartImplemented: true,
},

Expand Down
2 changes: 1 addition & 1 deletion ads/unruly.js
Expand Up @@ -30,5 +30,5 @@ export function unruly(global, data, scriptLoader = loadScript) {
siteId: data.siteId,
};

scriptLoader(global, 'https://video.unrulymedia.com/amp-demo/native-loader.js');
scriptLoader(global, 'https://video.unrulymedia.com/native/native-loader.js');
}
12 changes: 8 additions & 4 deletions test/functional/ads/test-unruly.js
Expand Up @@ -51,7 +51,7 @@ describe('unruly', () => {
};
unruly(mockGlobal, mockData, scriptLoader);
expect(expectedGlobal).to.equal(mockGlobal);
expect(expectedUrl).to.equal('https://video.unrulymedia.com/amp-demo/native-loader.js');
expect(expectedUrl).to.equal('https://video.unrulymedia.com/native/native-loader.js');
});

it('should throw if siteId is not provided', () => {
Expand All @@ -60,9 +60,13 @@ describe('unruly', () => {

const scriptLoader = () => {};

expect(
() => unruly(mockGlobal, mockData, scriptLoader)
).to.throw();
allowConsoleError(
() => {
expect(
() => unruly(mockGlobal, mockData, scriptLoader)
).to.throw();
}
);
});

});

0 comments on commit 3f99a34

Please sign in to comment.