Example #1
0
 userController.create(global, unConfirmedUser, function (err, createdUser) {
     assert.equal(err, null, err === null ? '' : err.message);
     
     authController.basicCredentialsCheck(
         global,
         UserEmailValid,
         UserPassword,
         function (err, result, data) {
             assert.equal(result, false);
             assert.equal(data.message, i18n.__("AccountResources.PleaseConfirmAccount"));
             done();
         });
 });
Example #2
0
            it('invalid credentials are not wellcome', function (done) {
                
                authController.basicCredentialsCheck(
                    global,    
                    'invalidUserName',
                    'invalidPassword',
                    function (err, result, data) {
                        assert.equal(result, false);
                        assert.equal(data.message, i18n.__("AccountResources.InvalidCredentials"));
                        done();
                    });

            });
Example #3
0
 userController.confirmEmail(global, createdUser.data.tokenId, function (err, confirmResult) {
     assert.equal(err, null, err === null ? '' : err.message);
     assert.equal(createdUser.isValid, true);
     assert.equal(resultHasMessage(i18n.__("AccountResources.AccountActivated"), confirmResult.messages), true);
     
     authController.basicCredentialsCheck(
         global,
         UserEmailValid,
         UserPassword,
         function (err, resultCredentialsCheck) {
             assert.equal(err, null);
             assert.equal(resultCredentialsCheck.email, userToTest.email);
             done();
         });
 });