 describe 'Projects', ->
   before (done) ->
     startApp ->
-      createTestUser (e, id)->
-        testUserId = id
+      user_test_helper.makeUser (user)->
+        testUser = user
         testProjects = _.map testProjects, (p)->
           p.createdDate = new Date()
-          p.userId = id
+          p.userId = user.id
           return p
         async.each testProjects, createProject, done
 
   after (done) ->
     async.each projectsCreated, deleteProject, ->
       ops = options()
-      request.del (base "/users/#{testUserId}"), ops, (e,r,b)->
+      request.del (base "/users/#{testUser.id}"), ops, (e,r,b)->
         r.statusCode.should.be.equal 200
         done()
 

    ops = options()
    ops.body =
      name: 'deleted-project'
      userId: testUserId
      createdDate: new Date()
    request.post (base '/projects'), ops, (e,r,b)->
      r.statusCode.should.be.equal 200

startApp = require './../start_app'
base = require './../base'
options = require './../options'
user_test_helper = require './user_test_helper'

validProject = (p)->
  p.should.have.property 'name'
