diff --git a/core/client/templates/settings/about.hbs b/core/client/templates/settings/about.hbs index e6d947e7b1..c6e79858bc 100644 --- a/core/client/templates/settings/about.hbs +++ b/core/client/templates/settings/about.hbs @@ -23,7 +23,7 @@
Environment:
{{environment}}
Database:
-
{{database}}
+
{{database}}
Mail:
{{#if mail}}{{mail}}{{else}}Native{{/if}}
diff --git a/core/test/functional/base.js b/core/test/functional/base.js index 660fe2d68c..148dbd8ad9 100644 --- a/core/test/functional/base.js +++ b/core/test/functional/base.js @@ -84,6 +84,10 @@ screens = { url: 'ghost/settings/general', selector: '.settings-nav-general.active' }, + 'settings.about': { + url: 'ghost/settings/about', + selector: '.settings-nav-about.active' + }, 'settings.users': { url: 'ghost/settings/users', linkSelector: '.settings-nav-users a', diff --git a/core/test/functional/client/settings_about_test.js b/core/test/functional/client/settings_about_test.js new file mode 100644 index 0000000000..83d601b883 --- /dev/null +++ b/core/test/functional/client/settings_about_test.js @@ -0,0 +1,40 @@ +// # About Test +// Test the various parts of the About page + +/*globals CasperTest, casper */ + +CasperTest.begin('About screen is correct', 10, function suite(test) { + casper.thenOpenAndWaitForPageLoad('settings.about', function testTitleAndUrl() { + test.assertTitle('Settings - About - Test Blog', 'Ghost admin has incorrect title'); + test.assertUrlMatch(/ghost\/settings\/about\/$/, 'Landed on the correct URL'); + }); + + casper.then(function testVersionNumber() { + var versionNumber = casper.getHTML('.about-ghost-intro .version'); + test.assertMatch(versionNumber, /\d+\.\d+\.\d+/, 'Version is a number'); // Tests for a pattern like 0.0.0 to v11111.3334534.2342453-beta + }); + + casper.then(function testDatabaseType() { + var databaseTypeText = casper.getHTML('.about-environment-database'); + test.assertMatch(databaseTypeText, /sqlite3|mysql|pg/gi, 'Database is an allowed type'); + }); + + casper.then(function testContributors() { + var firstContribImageSrc = casper.getElementAttribute('.top-contributors li:nth-child(1) a img', 'src'); + + test.assertElementCount('.top-contributors li', 20, '20 contributors are shown'); + + // Check first contributor image tag is on the page + test.assertExist('.top-contributors li:nth-child(1) img', 'First contributor image is in place'); + + // Check first contributor image resource exists & alt tag isnt empty + test.assertResourceExists(firstContribImageSrc, 'First contributor image file exists'); + test.assertDoesntExist('.top-contributors li:nth-child(1) a img[alt=""]', 'First contributor image alt is not empty'); + + // Check first contributor links to GitHub + test.assertExists('.top-contributors li:nth-child(1) a[href*="github.com"]', 'First contributor link to GitHub'); + + // Check first contributor links to GitHub + test.assertDoesntExist('.top-contributors li:nth-child(1) a[title=""]', 'First contributor title is not empty'); + }); +});