0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-08 02:52:39 -05:00

🐛Fixed author page has only shown primary author posts

closes #9545

- posts only showed on an author page when the author was primary
This commit is contained in:
CriticalRespawn 2018-04-10 21:56:25 +01:00 committed by Katharina Irrgang
parent 3a27e557ed
commit 6b9f9a0ece
2 changed files with 11 additions and 1 deletions

View file

@ -24,7 +24,7 @@
"author": {
"route": "/:t_author/:slug/",
"postOptions": {
"filter": "author:'%s'"
"filter": "authors:'%s'"
},
"data": {
"author": {

View file

@ -60,6 +60,14 @@ describe('Post API', function () {
should.exist(PostAPI);
describe('Browse', function () {
beforeEach(function () {
return db.knex('posts_authors').insert({
id: ObjectId.generate(),
post_id: testUtils.DataGenerator.forKnex.posts[0].id,
author_id: testUtils.DataGenerator.forKnex.users[1].id
});
});
beforeEach(function () {
localSettingsCache.permalinks = '/:slug/';
});
@ -388,6 +396,8 @@ describe('Post API', function () {
post.primary_author.slug.should.eql('joe-bloggs');
});
_.find(results.posts, {id: testUtils.DataGenerator.forKnex.posts[0].id}).authors.length.should.eql(2);
done();
}).catch(done);
});