2013-11-01 15:13:43 +04:00
|
|
|
/**
|
|
|
|
* Tests the default post page
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*globals CasperTest, casper, __utils__, url, testPost, falseUser, email */
|
2013-12-30 11:03:29 +04:00
|
|
|
|
2014-01-01 18:31:29 +04:00
|
|
|
// Tests when permalinks is set to date
|
2013-12-30 11:03:29 +04:00
|
|
|
CasperTest.begin('Post page does not load as slug', 2, function suite(test) {
|
2014-01-03 04:37:21 +04:00
|
|
|
CasperTest.Routines.togglePermalinks.run('on');
|
|
|
|
casper.thenOpen(url + 'welcome-to-ghost', function then(response) {
|
2013-12-30 11:03:29 +04:00
|
|
|
test.assertTitle('404 — Page Not Found', 'The post should return 404 page');
|
|
|
|
test.assertElementCount('.content .post', 0, 'There is no post on this page');
|
|
|
|
});
|
2014-01-03 04:37:21 +04:00
|
|
|
CasperTest.Routines.togglePermalinks.run('off');
|
|
|
|
}, false);
|
2013-12-30 11:03:29 +04:00
|
|
|
|
2013-11-01 15:13:43 +04:00
|
|
|
CasperTest.begin('Post page loads', 3, function suite(test) {
|
2014-01-01 15:17:35 +04:00
|
|
|
casper.thenOpen(url + 'welcome-to-ghost', function then(response) {
|
2013-11-01 15:13:43 +04:00
|
|
|
test.assertTitle('Welcome to Ghost', 'The post should have a title and it should be "Welcome to Ghost"');
|
|
|
|
test.assertElementCount('.content .post', 1, 'There is exactly one post on this page');
|
|
|
|
test.assertSelectorHasText('.poweredby', 'Proudly published with Ghost');
|
|
|
|
});
|
2014-01-03 04:37:21 +04:00
|
|
|
}, true);
|
2013-11-01 15:13:43 +04:00
|
|
|
|
2014-01-01 18:31:29 +04:00
|
|
|
CasperTest.begin('Test helpers on welcome post', 4, function suite(test) {
|
2013-11-01 15:13:43 +04:00
|
|
|
casper.start(url + 'welcome-to-ghost', function then(response) {
|
|
|
|
// body class
|
|
|
|
test.assertExists('body.post-template', 'body_class outputs correct post-template class');
|
|
|
|
test.assertExists('body.tag-getting-started', 'body_class outputs correct tag class');
|
|
|
|
// post class
|
|
|
|
test.assertExists('article.post', 'post_class outputs correct post class');
|
|
|
|
test.assertExists('article.tag-getting-started', 'post_class outputs correct tag class');
|
|
|
|
});
|
2014-01-01 15:17:35 +04:00
|
|
|
}, true);
|