2014-06-17 01:44:09 +04:00
|
|
|
// # Signup Test
|
|
|
|
// Test that signup works correctly
|
|
|
|
|
2014-09-03 19:42:55 +04:00
|
|
|
/*globals CasperTest */
|
2014-06-25 16:12:48 +04:00
|
|
|
|
2014-06-26 17:06:38 +04:00
|
|
|
CasperTest.begin('Ghost signup fails properly', 0, function suite(test) {
|
2014-09-03 19:42:55 +04:00
|
|
|
/*jshint unused:false */
|
2014-06-25 16:12:48 +04:00
|
|
|
/*
|
2014-06-17 01:44:09 +04:00
|
|
|
casper.thenOpenAndWaitForPageLoad('signup', function then() {
|
2014-07-01 03:26:08 +04:00
|
|
|
test.assertUrlMatch(/ghost\/signup\/$/, 'Landed on the correct URL');
|
2014-06-17 01:44:09 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
casper.then(function signupWithShortPassword() {
|
2014-06-24 15:17:40 +04:00
|
|
|
casper.fillAndSave('#signup', {email: email, password: 'test'});
|
2014-06-17 01:44:09 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
// should now throw a short password error
|
|
|
|
casper.waitForSelector('.notification-error', function onSuccess() {
|
|
|
|
test.assert(true, 'Got error notification');
|
|
|
|
test.assertSelectorDoesntHaveText('.notification-error', '[object Object]');
|
|
|
|
}, function onTimeout() {
|
|
|
|
test.assert(false, 'No error notification :(');
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.then(function signupWithLongPassword() {
|
2014-06-24 15:17:40 +04:00
|
|
|
casper.fillAndSave('#signup', {email: email, password: 'testing1234'});
|
2014-06-17 01:44:09 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
// should now throw a 1 user only error
|
|
|
|
casper.waitForSelector('.notification-error', function onSuccess() {
|
|
|
|
test.assert(true, 'Got error notification');
|
|
|
|
test.assertSelectorDoesntHaveText('.notification-error', '[object Object]');
|
|
|
|
}, function onTimeout() {
|
|
|
|
test.assert(false, 'No error notification :(');
|
|
|
|
});
|
2014-06-25 16:12:48 +04:00
|
|
|
*/
|
|
|
|
}, true);
|