test: add template enclosure test cases

This commit is contained in:
DIYgod
2019-08-23 15:44:52 +08:00
parent 9a03bd4fe9
commit 745eb0d52a
4 changed files with 24 additions and 2 deletions

View File

@@ -49,6 +49,17 @@ module.exports = async (ctx) => {
item = null;
}
if (ctx.params.id === 'enclosure') {
item = [
{
title: '',
link: 'https://github.com/DIYgod/RSSHub/issues/1',
enclosure_url: 'https://github.com/DIYgod/RSSHub/issues/1',
enclosure_length: 3661,
},
];
}
if (ctx.query.mode === 'fulltext') {
item = [
{
@@ -60,6 +71,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `Test ${ctx.params.id}`,
itunes_author: ctx.params.id === 'enclosure' ? 'DIYgod' : null,
link: 'https://github.com/DIYgod/RSSHub',
item,
allowEmpty: ctx.params.id === 'allow_empty',