             type: 'array'
             items: type: 'string'
         required: ['id', 'tags']
+
       beforeEach ->
-        post = Factory.build 'post', tags: ['dude']
         renderer = new Renderer 'node/just_node', [post]
-      it 'returns JSON', (done) ->
+
+      it 'creates json array', ->
+        renderer.render (data) ->
+          jsData = JSON.parse data
+          expect(jsData).to.be.an.Array
+
+      it 'has one object', ->
+        renderer.render (data) ->
+          jsData = JSON.parse data
+          expect(jsData.length).to.equal 1
+
+      it 'has no errors', ->
         renderer.render (data) ->
           jsData = JSON.parse data
           validate = json.validate(jsData[0], nodeSchema)
-          expect(jsData).to.be.an.Array
-          expect(jsData.length).to.equal 1
           expect(validate.errors).to.deep.equal []
-          done()
+
     context 'attributes', ->
       attributesSchema =
         id: "/attributesSchema"

Renderer = require "#{__rootdir}/lib/jabl/renderer"

describe 'lib/jabl/renderer', ->
  renderer = null

  describe '#render', ->
    context 'node + attribute', ->

        required: ['id', 'tags', 'title', 'content']

      beforeEach ->
        renderer = new Renderer 'node/return_property', [post]

      it 'creates json array', ->
        renderer.render (data) ->
          jsData = JSON.parse data
          expect(jsData).to.be.an.Array

      it 'has one object', ->
        renderer.render (data) ->
          jsData = JSON.parse data
          expect(jsData.length).to.equal 1

      it 'has no errors', ->
        renderer.render (data) ->
          jsData = JSON.parse data
          validate = json.validate(jsData[0], nodeSchema)
          expect(validate.errors).to.deep.equal []

    context 'node', ->
      nodeSchema =
        id: "/nodeSchema"
