 
         done()
       )
-    ).catch( (err) ->
-      console.error err
-      throw new Error(err)
-    )
+    ).catch(done)
 
   async.series([helpers.createSection, helpers.createSection], createPageWithSection)
 )

            done()
          )
      )
    ).catch( (err) ->
      console.error err
      throw new Error(err)
    )
)

test('PUT nesting a section in a page with existing sections', (done) ->

test('GET show', (done) ->
  data =
    title: "new page"
  helpers.createPage().
    then( (page) ->
      Promise.promisify(request.get, request)({
        url: helpers.appurl("api/pages/#{page.id}")
        json: true
      }).spread( (res, body) ->
        assert.equal res.statusCode, 200

        reloadedPage = body
