From ccaceb73107618d704eb437427fb4a0571003db9 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Tue, 25 Feb 2014 06:44:06 +0000 Subject: [PATCH] Renamed client-side admin url helper fixes #2254 - includes test --- core/client/helpers/index.js | 2 +- core/test/functional/admin/login_test.js | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/core/client/helpers/index.js b/core/client/helpers/index.js index 474a1e7de0..462c4447e5 100644 --- a/core/client/helpers/index.js +++ b/core/client/helpers/index.js @@ -29,7 +29,7 @@ return date; }); - Handlebars.registerHelper('adminUrl', function () { + Handlebars.registerHelper('admin_url', function () { return Ghost.paths.subdir + '/ghost'; }); diff --git a/core/test/functional/admin/login_test.js b/core/test/functional/admin/login_test.js index be2dfb07e8..394532f71f 100644 --- a/core/test/functional/admin/login_test.js +++ b/core/test/functional/admin/login_test.js @@ -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);