             ])
 
         it 'should save relations to dedicated hash', ->
-            expect(simpleRelationDefinition.relations).to.have.property('author')
+            expect(relationDefinition.relations).to.have.property('author')
 
         it 'should save relation direction', ->
-            expect(simpleRelationDefinition.relations.author.out).to.have.property('name', 'CREATED_BY')
+            expect(relationDefinition.relations.author.out).to.have.property('name', 'CREATED_BY')
 
         it 'should save relation attributes', ->
-            expect(simpleRelationDefinition.relations.author.out).to.have.property('attributes')
-            expect(simpleRelationDefinition.relations.author.out.attributes).to.contain('when')
+            expect(relationDefinition.relations.author.out).to.have.property('attributes')
+            expect(relationDefinition.relations.author.out.attributes).to.contain('when')
 
         it 'should treat relations as implicit properties declarations', ->
-            expect(simpleRelationDefinition.properties).to.have.property('author')
-            expect(simpleRelationDefinition.properties.author).to.have.property('type', 'User')
+            expect(relationDefinition.properties).to.have.property('author')
+            expect(relationDefinition.properties.author).to.have.property('type', 'User')
 
         it 'should specify what property is managed by relation', ->
-            expect(simpleRelationDefinition.relations.author).to.have.property('property', 'author')
+            expect(relationDefinition.relations.author).to.have.property('property', 'author')
 
         it 'should treat relation attributes as implicit properties declarations', ->
-            expect(simpleRelationDefinition.properties).to.have.property('when').deep.equals
+            expect(relationDefinition.properties).to.have.property('when').deep.equals
                 type: 'object'
                 title: 'DateTime'
 

            ])

        it 'should save indexes to dedicated hash', ->
            expect(simpleIndexSchema.definitions.Tweet).to.have.property('indexes').deep.equals [
                key: [ 'id' ]
                type: 'unique'
            ]

        it 'should add index properties and make them required if necessary', ->
            expect(simpleIndexSchema.definitions.Tweet)
                .to.have.property('properties').deep.equals(id: {})
            expect(simpleIndexSchema.definitions.Tweet)
                .to.have.property('required').deep.equals([ 'id' ])


    describe 'relations', ->
        simpleRelationDefinition = null

        beforeEach ->
            simpleRelationDefinition = postprocessor.postprocess([
                rule: 'relation'
                out:
                    name: 'CREATED_BY'


    describe 'enumerations', ->
        simpleEnumerationSchema = null
        enumerationDefinition = null

        beforeEach ->
            simpleEnumerationSchema = postprocessor.postprocess([
