                 @response = res
                 @view = null
                 if res
-                  @view = JSON.parse res.body
+                  @view = parseJSON res.body
                 done()
 
             context 'POST /api/:user/datasets/<dataset>/views', ->

            email: 'random@example.org'
            displayName: 'Ran Dom Test'
        , (err, resp, body) =>
          obj = JSON.parse body
          @token = obj.token
          resp.should.have.status 201
          done(err)

        context 'GET /api/:user/datasets/:id', ->
          it 'returns a single dataset', (done)  ->
            request.get "#{serverURL}/api/#{@user}/datasets/#{@dataset.box}", (err, res) ->
              newDataset = parseJSON res.body
              should.exist newDataset.box
              done()

          it 'dataset has a created date', (done)  ->
            request.get "#{serverURL}/api/#{@user}/datasets/#{@dataset.box}", (err, res) ->
              newDataset = parseJSON res.body
              Date.parse(newDataset.createdDate).should.be.above(0)
              done()

          it 'dataset has a creator short name', (done)  ->
            request.get "#{serverURL}/api/#{@user}/datasets/#{@dataset.box}", (err, res) ->
              newDataset = parseJSON res.body
              'ickletest'.should.equal newDataset.creatorShortName
              done()

          it 'dataset has a creator display name', (done)  ->
            request.get "#{serverURL}/api/#{@user}/datasets/#{@dataset.box}", (err, res) ->
              newDataset = parseJSON res.body
              'Ickle Test'.should.equal newDataset.creatorDisplayName
              done()

