Renamed client-side admin url helper

fixes #2254

- includes test
This commit is contained in:
Hannah Wolfe 2014-02-25 06:44:06 +00:00
parent 2246b8a803
commit ccaceb7310
2 changed files with 12 additions and 3 deletions

View File

@ -29,7 +29,7 @@
return date;
});
Handlebars.registerHelper('adminUrl', function () {
Handlebars.registerHelper('admin_url', function () {
return Ghost.paths.subdir + '/ghost';
});

View File

@ -31,10 +31,19 @@ CasperTest.begin('Ensure a User is Registered', 2, function suite(test) {
});
}, true);
CasperTest.begin("Ghost admin will load login page", 2, function suite(test) {
CasperTest.begin("Ghost admin will load login page", 3, function suite(test) {
casper.thenOpen(url + "ghost", function testTitleAndUrl() {
test.assertTitle("Ghost Admin", "Ghost admin has no title");
test.assertUrlMatch(/ghost\/signin\/$/, 'We should be presented with the signin page.');
casper.then(function testLink() {
var link = this.evaluate(function (selector) {
return document.querySelector(selector).getAttribute('href');
}, '.forgotten-password');
casper.echo('LINK' + link);
test.assert(link === '/ghost/forgotten/', 'Has correct forgotten password link');
});
});
}, true);
@ -98,7 +107,7 @@ CasperTest.begin("Login limit is in place", 3, function suite(test) {
}, function onTimeout() {
test.assert(false, 'We did not trip the login limit.');
});
// This test used login, add a wait to
// This test used login, add a wait to
// ensure future tests don't get tripped up by this.
casper.wait(2000);
}, true);