mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-04 21:15:55 +01:00
Changed User.create signature to accept a hash, added a couple of utility functions as well
This commit is contained in:
@@ -26,16 +26,16 @@ describe('User', function() {
|
||||
|
||||
describe('when created', function() {
|
||||
it('should be created properly', function(done){
|
||||
User.create(userData.name, userData.password, userData.email, function(error,userId){
|
||||
User.create({usename: userData.name, password: userData.password, email: userData.email}, function(error,userId){
|
||||
assert.equal(error, null, 'was created with error');
|
||||
assert.ok(userId);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should have a valid email', function() {
|
||||
it('should have a valid email, if using an email', function() {
|
||||
assert.throws(
|
||||
User.create(userData.name, userData.password, 'fakeMail',function(){}),
|
||||
User.create({username: userData.name, password: userData.password, email: 'fakeMail'},function(){}),
|
||||
Error,
|
||||
'does not validate email'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user