Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,19 @@ describe('utils: transformReadyToAbsolute()', function () {
result.should.equal('https://site-base.com/content/media/video.mp4');
});

it('converts media url with CDN and subdirectory in site URL', function () {
const storageCdn = 'https://storage.ghost.io/c/test-uuid';
const subdirSiteUrl = 'https://mysite.com/blog';
const options = {
staticMediaUrlPrefix: 'content/media',
mediaBaseUrl: storageCdn
};

const result = transformReadyToAbsolute('__GHOST_URL__/content/media/video.mp4', subdirSiteUrl, options);

result.should.equal('https://storage.ghost.io/c/test-uuid/content/media/video.mp4');
});

it('uses CDN for media and site URL for files when only media CDN is configured', function () {
const options = {
staticImageUrlPrefix: 'content/images',
Expand Down