var pokerUser = require('../../lib/poker-user.js');

describe('User', function() {
    it('should create a new user', function(done) {
        var userDetails = {
            name: 'Horst Egon',
            role: 'developer'
        };

        var user = pokerUser.create(userDetails);

        user.on('created', function(newUser) {
            expect(newUser.id.length).toBe(40);
            expect(newUser.name).toEqual(userDetails.name);
            expect(newUser.role).toEqual(userDetails.role);
            done();
        });
    });
});
@@ -43,16 +43,48 @@
 ser.js')
+,%0A    events = require('events')
 ;%0A%0Adescr
@@ -311,16 +311,122 @@
 etails);
+%0A        expect(user.name).toEqual(userDetails.name);%0A        expect(user.role).toEqual(userDetails.role);
 %0A%0A      
@@ -455,23 +455,16 @@
 unction(
-newUser
 ) %7B%0A    
@@ -474,28 +474,25 @@
      expect(
-newU
+u
 ser.id.lengt
@@ -527,57 +527,252 @@
 ect(
-newUser.name).toEqual(userDetails.name)
+user.id).toMatch('%5E%5Ba-zA-Z0-9%5D*$');%0A            done();%0A        %7D);%0A    %7D);%0A%0A    it('should always create a new id', function(done) %7B%0A        var userDetails = %7B%0A            name: 'John Doe',%0A            role: 'scrumMaster'%0A        %7D
 ;%0A
+%0A
         
     
@@ -771,40 +771,124 @@
     
-    expect(newUser.role).toEqual
+// Promises needed here%0A//        firstUser = pokerUser.create(userDetails);%0A//        secondUser = pokerUser.create
 (use
@@ -899,24 +899,21 @@
 ails
-.role
 );%0A
+//
         
     
@@ -904,33 +904,69 @@
 ;%0A//        
-    done(
+expect(firstUser.id).toNotEqual(secondUser.id
 );%0A        %7D
@@ -956,31 +956,35 @@
 er.id);%0A        
-%7D
+done(
 );%0A    %7D);%0A%7D);

check for correctness of id + pending spec