mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 21:40:39 +03:00
Display 404 page if tag does not exist.
closes #2667 - if tag result is '' 404 instead of rendering an empty page - added test for /tag/asdf should 404
This commit is contained in:
parent
10759ed45a
commit
eb2fdc44fb
@ -133,6 +133,10 @@ frontendControllers = {
|
||||
tag: page.meta.filters.tags ? page.meta.filters.tags[0] : ''
|
||||
});
|
||||
|
||||
// If the resulting tag is '' then 404.
|
||||
if (!result.tag) {
|
||||
return next();
|
||||
}
|
||||
res.render(view, result);
|
||||
});
|
||||
});
|
||||
|
@ -14,4 +14,11 @@ CasperTest.begin('Check frontend route not found (404)', 2, function suite(test)
|
||||
test.assertEqual(response.status, 404, 'Response status should be 404.');
|
||||
test.assertSelectorHasText('.error-code', '404');
|
||||
});
|
||||
}, true);
|
||||
}, true);
|
||||
|
||||
CasperTest.begin('Check frontend tag route not found (404)', 2, function suite(test) {
|
||||
casper.thenOpen(url + 'tag/asdf/', function (response) {
|
||||
test.assertEqual(response.status, 404, 'Response status should be 404.');
|
||||
test.assertSelectorHasText('.error-code', '404');
|
||||
});
|
||||
}, true);
|
||||
|
Loading…
Reference in New Issue
Block a user