mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-12 06:25:51 +03:00
Merge pull request #5863 from acburdine/author-edit
Add `/author/:slug/edit/` route to frontend
This commit is contained in:
commit
07e18cbdff
@ -66,6 +66,9 @@ frontendRoutes = function frontendRoutes(middleware) {
|
|||||||
|
|
||||||
// Authors
|
// Authors
|
||||||
authorRouter.route('/').get(frontend.author);
|
authorRouter.route('/').get(frontend.author);
|
||||||
|
authorRouter.route('/edit?').get(function redirect(req, res) {
|
||||||
|
res.redirect(subdir + '/ghost/team/' + req.params.slug + '/');
|
||||||
|
});
|
||||||
authorRouter.route('/' + routeKeywords.page + '/:page/').get(frontend.author);
|
authorRouter.route('/' + routeKeywords.page + '/:page/').get(frontend.author);
|
||||||
authorRouter.use(rssRouter);
|
authorRouter.use(rssRouter);
|
||||||
|
|
||||||
|
@ -583,6 +583,32 @@ describe('Frontend Routing', function () {
|
|||||||
.end(doEnd(done));
|
.end(doEnd(done));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Author edit', function () {
|
||||||
|
it('should redirect without slash', function (done) {
|
||||||
|
request.get('/author/ghost-owner/edit')
|
||||||
|
.expect('Location', '/author/ghost-owner/edit/')
|
||||||
|
.expect('Cache-Control', testUtils.cacheRules.year)
|
||||||
|
.expect(301)
|
||||||
|
.end(doEnd(done));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should redirect to editor', function (done) {
|
||||||
|
request.get('/author/ghost-owner/edit/')
|
||||||
|
.expect('Location', '/ghost/team/ghost-owner/')
|
||||||
|
.expect('Cache-Control', testUtils.cacheRules['public'])
|
||||||
|
.expect(302)
|
||||||
|
.end(doEnd(done));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should 404 for something that isn\'t edit', function (done) {
|
||||||
|
request.get('/author/ghost-owner/notedit/')
|
||||||
|
.expect('Cache-Control', testUtils.cacheRules['private'])
|
||||||
|
.expect(404)
|
||||||
|
.expect(/Page not found/)
|
||||||
|
.end(doEnd(done));
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Tag pages', function () {
|
describe('Tag pages', function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user