0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00
ghost/core/test/functional/client/signup_test.js
Hannah Wolfe 962accfec7 Functional tests for Ember
issue #2989

- Adds lodash for bind and isNumber - looking for a better solution for this
- Still needs the editor and flow tests porting
- Some of the tests are commented out awaiting further implementations
2014-06-20 15:20:59 +01:00

32 lines
No EOL
1.3 KiB
JavaScript

// # Signup Test
// Test that signup works correctly
CasperTest.emberBegin("Ghost signup fails properly", 5, function suite(test) {
casper.thenOpenAndWaitForPageLoad('signup', function then() {
test.assertUrlMatch(/ghost\/ember\/signup\/$/, 'Landed on the correct URL');
});
casper.then(function signupWithShortPassword() {
casper.fillAndSave("#signup", {email: email, password: 'test'});
});
// 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() {
casper.fillAndSave("#signup", {email: email, password: 'testing1234'});
});
// 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 :(');
});
}, true);