 
   it 'should pass err if url is not specified', (done) ->
 
-    postParams = getPostParams
+    postParams = generatePostParams
       url : ''
 
     request.post postParams, (err, res, body) ->

Bongo                                         = require 'bongo'

{ daisy }                                     = Bongo
{ expect }                                    = require "chai"
{ RegisterHandlerHelper : { getPostParams },
  getRandomString }                           = require '../../../testhelper'

hat                                           = require 'hat'
request                                       = require 'request'


###
# Variables
###
postParams = {}


# here we have actual tests
runTests = -> describe 'server.handlers.register', ->

  it 'should send HTTP 400 if username is in use', (done) ->

    randomString = getRandomString()
    postParams   = getPostParams
      body        :
        username  : randomString



  it 'should send HTTP 301 if request is not XHR',  (done) ->

    postParams = generatePostParams
      headers :
        'x-requested-with' : 'this is not an XHR'

