2014-06-16 16:44:09 -05:00
|
|
|
// # Signup Test
|
|
|
|
// Test that signup works correctly
|
|
|
|
|
2014-06-24 06:17:40 -05:00
|
|
|
/*global CasperTest, casper, email */
|
|
|
|
|
2014-06-25 07:12:48 -05:00
|
|
|
|
|
|
|
CasperTest.emberBegin('Ghost signup fails properly', 0, function suite(test) {
|
|
|
|
/*
|
2014-06-16 16:44:09 -05:00
|
|
|
casper.thenOpenAndWaitForPageLoad('signup', function then() {
|
|
|
|
test.assertUrlMatch(/ghost\/ember\/signup\/$/, 'Landed on the correct URL');
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.then(function signupWithShortPassword() {
|
2014-06-24 06:17:40 -05:00
|
|
|
casper.fillAndSave('#signup', {email: email, password: 'test'});
|
2014-06-16 16:44:09 -05: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 06:17:40 -05:00
|
|
|
casper.fillAndSave('#signup', {email: email, password: 'testing1234'});
|
2014-06-16 16:44:09 -05: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 07:12:48 -05:00
|
|
|
*/
|
|
|
|
}, true);
|