mirror of
https://github.com/LightAir/turbo-rss.git
synced 2026-02-04 12:06:20 +00:00
Добавлена опция relatedfinity для формирования непрерывной ленты статей
This commit is contained in:
@@ -46,6 +46,7 @@ test('related item', function(t) {
|
||||
url: 'http://example.com/article4?this&that',
|
||||
author: 'LightAir',
|
||||
date: 'May 27, 2018 00:00 AM',
|
||||
menu: '<a href="http://example.com/page1.html">Текст ссылки</a> <a href="http://example.com/page2.html">Текст ссылки</a>',
|
||||
content: '<p>hello</p>',
|
||||
related: [{
|
||||
link: 'http://example.com/related/post1',
|
||||
@@ -60,3 +61,34 @@ test('related item', function(t) {
|
||||
|
||||
t.equal(feed.xml(), expectedOutput.relatedItem.trim());
|
||||
});
|
||||
|
||||
test('related item', function(t) {
|
||||
t.plan(1);
|
||||
let feed = new YTurbo({
|
||||
title: 'title',
|
||||
description: 'description',
|
||||
link: 'http://example.com/rss.xml',
|
||||
site_url: 'http://example.com'
|
||||
});
|
||||
|
||||
feed.item({
|
||||
title: 'item title',
|
||||
image_url: 'http://example.com/example.png',
|
||||
url: 'http://example.com/article4?this&that',
|
||||
author: 'LightAir',
|
||||
date: 'May 27, 2018 00:00 AM',
|
||||
content: '<p>hello</p>',
|
||||
relatedfinity: true,
|
||||
related: [{
|
||||
link: 'http://example.com/related/post1',
|
||||
image_url: 'http://example.com/i/img1.jpg',
|
||||
text: 'related link text 1'
|
||||
}, {
|
||||
link: 'http://example.com/related/post2',
|
||||
image_url: 'http://example.com/i/img2.jpg',
|
||||
text: 'related link text 2'
|
||||
}]
|
||||
});
|
||||
|
||||
t.equal(feed.xml(), expectedOutput.relatedItemInfinity.trim());
|
||||
});
|
||||
Reference in New Issue
Block a user