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

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

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

          it "404 errors if the dataset doesn't exist", (done) ->

              res.should.have.status 200
              request.get "#{serverURL}/api/#{@user}/datasets/#{@dataset.box}", (err, res) =>
                @dataset = JSON.parse res.body
                'Cheese'.should.equal @dataset.displayName
                done(err)

          it 'changes the owner of a single dataset', (done) ->
