mirror of
https://github.com/LightAir/turbo-rss.git
synced 2026-02-04 12:06:20 +00:00
Merge pull request #24 from apelsophiebarat/patch-1
Update default channel link url in rss.js
This commit is contained in:
@@ -66,7 +66,7 @@ function generateXML (data){
|
||||
var channel = [];
|
||||
channel.push({ title: { _cdata: data.title } });
|
||||
channel.push({ description: { _cdata: data.description || data.title } });
|
||||
channel.push({ link: data.site_url || 'http://github.com/dylan/node-rss' });
|
||||
channel.push({ link: data.site_url || 'http://github.com/dylang/node-rss' });
|
||||
// image_url set?
|
||||
if (data.image_url) {
|
||||
channel.push({ image: [ {url: data.image_url}, {title: data.title}, {link: data.site_url} ] });
|
||||
|
||||
@@ -9,9 +9,9 @@ describe('rss module', function(done) {
|
||||
|
||||
it('should work with an empty feed', function(done) {
|
||||
var feed = new RSS();
|
||||
expect(feed.xml()).to.equal('<?xml version="1.0" encoding="UTF-8"?>\n<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Untitled RSS Feed]]></title><description><![CDATA[Untitled RSS Feed]]></description><link>http://github.com/dylan/node-rss</link><generator>RSS for Node</generator><lastBuildDate>' + new Date().toUTCString() +'</lastBuildDate></channel></rss>');
|
||||
expect(feed.xml()).to.equal('<?xml version="1.0" encoding="UTF-8"?>\n<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Untitled RSS Feed]]></title><description><![CDATA[Untitled RSS Feed]]></description><link>http://github.com/dylang/node-rss</link><generator>RSS for Node</generator><lastBuildDate>' + new Date().toUTCString() +'</lastBuildDate></channel></rss>');
|
||||
feed.item();
|
||||
expect(feed.xml()).to.equal('<?xml version="1.0" encoding="UTF-8"?>\n<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Untitled RSS Feed]]></title><description><![CDATA[Untitled RSS Feed]]></description><link>http://github.com/dylan/node-rss</link><generator>RSS for Node</generator><lastBuildDate>' + new Date().toUTCString() +'</lastBuildDate><item><title><![CDATA[No title]]></title><guid isPermaLink="false">No title</guid></item></channel></rss>');
|
||||
expect(feed.xml()).to.equal('<?xml version="1.0" encoding="UTF-8"?>\n<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Untitled RSS Feed]]></title><description><![CDATA[Untitled RSS Feed]]></description><link>http://github.com/dylang/node-rss</link><generator>RSS for Node</generator><lastBuildDate>' + new Date().toUTCString() +'</lastBuildDate><item><title><![CDATA[No title]]></title><guid isPermaLink="false">No title</guid></item></channel></rss>');
|
||||
done();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user