Skip to content

Commit

Permalink
test(rss2) : test rss2 icon config
Browse files Browse the repository at this point in the history
  • Loading branch information
sehajyang committed Nov 5, 2019
1 parent e4ea6f6 commit 417898d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,35 @@ describe('Feed generator', () => {

$('feed>icon').length.should.eql(0);
});

it('Icon (rss2)', () => {
hexo.config.url = 'http://example.com';
hexo.config.root = '/';

hexo.config.feed = {
type: 'rss2',
path: 'rss2.xml',
icon: 'icon.svg'
};

const result = generator(locals);
const $ = cheerio.load(result.data);

$('rss>channel>image>url').text().should.eql(full_url_for.call(hexo, hexo.config.feed.icon));
});

it('Icon (rss2) - no icon', () => {
hexo.config.feed = {
type: 'rss2',
path: 'rss2.xml',
icon: undefined
};

const result = generator(locals);
const $ = cheerio.load(result.data);

$('rss>channel>image').length.should.eql(0);
});
});

describe('Autodiscovery', () => {
Expand Down

0 comments on commit 417898d

Please sign in to comment.