From eadbf7dffbf0caa1346c56c1695cec3199d41fc9 Mon Sep 17 00:00:00 2001 From: balduv Date: Wed, 5 Feb 2014 13:59:07 +0800 Subject: [PATCH] Removed author tag inside channel tag in RSS closes #2114 - instead of putting author in feedOptions of node-rss, it was moved to itemOptions - supplying author: user ? user.name : null in itemOptions will still result to creating a dc:creator tag inside item tags so the info needed to have the author is still there like before - node-rss should however still fix this quirk to not have that nasty author tag in channel tag when you supply author in feedOptions --- core/server/controllers/frontend.js | 4 ++-- core/test/functional/frontend/feed_test.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/core/server/controllers/frontend.js b/core/server/controllers/frontend.js index ee288337a0..2a9ceb1f09 100644 --- a/core/server/controllers/frontend.js +++ b/core/server/controllers/frontend.js @@ -155,7 +155,6 @@ frontendControllers = { title: title, description: description, generator: 'Ghost v' + res.locals.version, - author: user ? user.name : null, feed_url: feedUrl, site_url: siteUrl, ttl: '60' @@ -184,7 +183,8 @@ frontendControllers = { guid: post.uuid, url: config.paths.urlFor('post', {post: post, permalinks: permalinks}, true), date: post.published_at, - categories: _.pluck(post.tags, 'name') + categories: _.pluck(post.tags, 'name'), + author: user ? user.name : null }, content = post.html; diff --git a/core/test/functional/frontend/feed_test.js b/core/test/functional/frontend/feed_test.js index 7805a25b90..791d14e83a 100644 --- a/core/test/functional/frontend/feed_test.js +++ b/core/test/functional/frontend/feed_test.js @@ -29,6 +29,19 @@ CasperTest.begin('Ensure that RSS is available', 11, function suite(test) { }); }, false); +CasperTest.begin('Ensure that author element is not included. Only dc:creator', 3, function suite(test) { + CasperTest.Routines.togglePermalinks.run('off'); + casper.thenOpen(url + 'rss/', function (response) { + var content = this.getPageContent(), + author = '', + postCreator = ''; + + test.assertEqual(response.status, 200, 'Response status should be 200.'); + test.assert(content.indexOf(author) < 0, 'Author element should not be included'); + test.assert(content.indexOf(postCreator) >= 0, 'Welcome post should have Test User as the creator.'); + }); +}, false); + CasperTest.begin('Ensures dated permalinks works with RSS', 2, function suite(test) { CasperTest.Routines.togglePermalinks.run('on'); casper.thenOpen(url + 'rss/', function (response) {